Fix checking log file size if it doesnt exist

This commit is contained in:
Yegor Vialov 2020-03-09 15:01:53 +00:00
parent e6a7fd2dfe
commit 959ff21b9b

View File

@ -223,7 +223,7 @@ void updateDeviceLocationIsolate() {
print("[Background $backgroundTask] Writing log data...");
try {
var fileMode;
if (logFile.lengthSync() < 5000000) {
if (logFile.existsSync() && logFile.lengthSync() < 5000000) {
fileMode = FileMode.append;
} else {
fileMode = FileMode.write;