fix(backend): fixed wrong error check

This commit is contained in:
Alexander Zavorotynskiy 2022-11-21 11:02:00 +01:00
parent b26a1c28b6
commit c33279c141

View file

@ -95,7 +95,7 @@ func (s *Storage) uploadKey(sessID uint64, suffix string, shouldSplit bool, retr
// Check file size before download into memory
info, err := os.Stat(filePath)
if err != nil {
if err == nil {
if info.Size() > s.cfg.MaxFileSize {
log.Printf("big file, size: %d, session: %d", info.Size(), sessID)
return nil