mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 17:25:32 +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
|
||||
if (await oldSubDir.list().isEmpty) await oldSubDir.delete();
|
||||
if (await oldSubDir.exists() && await oldSubDir.list().isEmpty) {
|
||||
await oldSubDir.delete();
|
||||
}
|
||||
}
|
||||
// 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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue