fix crash on nil cache

This commit is contained in:
YouROK
2021-04-27 11:18:49 +03:00
parent df1d2e4d2f
commit bd660fc39a

View File

@@ -172,7 +172,9 @@ func (t *Torrent) progressEvent() {
t.BytesReadUsefulData = st.BytesRead.Int64() t.BytesReadUsefulData = st.BytesRead.Int64()
t.BytesWrittenData = st.BytesWritten.Int64() t.BytesWrittenData = st.BytesWritten.Int64()
t.PreloadedBytes = t.cache.GetState().Filled if t.cache != nil {
t.PreloadedBytes = t.cache.GetState().Filled
}
} else { } else {
t.DownloadSpeed = 0 t.DownloadSpeed = 0
t.UploadSpeed = 0 t.UploadSpeed = 0