mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-21 16:01:58 +00:00
Fix directory deletion logic to check existence before deletion
This commit is contained in:
parent
24849cc000
commit
c649525145
1 changed files with 6 additions and 2 deletions
|
|
@ -133,10 +133,14 @@ Future<void> _migrateOldLayout() async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// remove subfolder if empty
|
// remove subfolder if empty
|
||||||
if (await oldSubDir.list().isEmpty) await oldSubDir.delete();
|
if (await oldSubDir.exists() && await oldSubDir.list().isEmpty) {
|
||||||
|
await oldSubDir.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Clean up old empty folder
|
// Clean up old empty folder
|
||||||
if (await oldRoot.list().isEmpty) await oldRoot.delete();
|
if (await oldRoot.exists() && await oldRoot.list().isEmpty) {
|
||||||
|
await oldRoot.delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends ConsumerStatefulWidget {
|
class MyApp extends ConsumerStatefulWidget {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue