Skip to content

Commit

Permalink
fix crash in recoverAllSaveStates in empty libs
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Mattiello <git@joemattiello.com>
  • Loading branch information
JoeMatt committed Dec 3, 2024
1 parent c43a97b commit d5cc904
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public extension RomDatabase {
let saveStatesDirectory: URL = Paths.saveSavesPath
// iterate sub-dirs calling recoverSaveStates(forPath: path)
let fm = FileManager.default
let subdirectories = try! fm.contentsOfDirectory(at: saveStatesDirectory, includingPropertiesForKeys: nil, options: [.skipsHiddenFiles])
guard let subdirectories = try? fm.contentsOfDirectory(at: saveStatesDirectory, includingPropertiesForKeys: nil, options: [.skipsHiddenFiles]) else {
return
}
for subdirectory in subdirectories {
recoverSaveStates(forPath: subdirectory)
}
Expand Down

0 comments on commit d5cc904

Please sign in to comment.