T-Pau / Ready

A Home Computer Emulator for iPad.
Other
57 stars 6 forks source link

Adding games or creating from Inbox fails due to missing Library folder #6

Closed kyelewis closed 4 years ago

kyelewis commented 4 years ago

Adding games from the Library, Favorites or Tools view, or using "Create Library Entry" from Inbox, all fail because the Game NSManagedObject fails to initialize properly.

In the init() on Game.swift Line 304,

try FileManager.default.createDirectory(at: directoryURL, withIntermediateDirectories: false, attributes: [:])

fails because the Library directory does not exist, and withIntermediateDirectories is false. This error is silent because the call is wrapped in a try, but the catch block returns nil and does not handle the error in any other way.

Can be resolved by changing withIntermediateDirectories to true, or otherwise ensuring the Library directory is created prior to this call.

dillof commented 4 years ago

Good catch, thanks. I've fixed this now, and on a fresh install the game directory gets created.