File IO : minor : Crash when attempting to load file...

Marked as minor because the conditions required to trigger this crash are fairly obscure, and I doubt any data loss is even possible.

You’ll need two Scrivener projects to trigger this bug. Project1 should be set to Locked using the Finder. Project2 should be left normal. Open Project1 in Scrivener, close the project, and then attempt to load Project2 using any method. The application will crash before it even gets a chance to load Project2.

Crash log

I couldn’t recreate this (using beta 1), but I’ve seen this crash in other circumstances, and am hoping that it is fixed for beta 2. Not sure though. Because of the fact that .scriv files are really packages and of the way Scrivener loads them, trying to load a locked .scriv file could well result in wacky and undefined behaviour. But please do try to crash beta 2 in the same way… :slight_smile:

Will do. Odd that you cannot recreate it. It happens 100% of the time for me.

Hmm… Okay, I’ve found this one (reproduced it, that is). It’s problematic. For some reason, if a file can’t open properly, when it closes certain aspects of it don’t close properly, and stay around in the background, still listening to things. Then they try to act when they hear certain things, realise they don’t actually exist and get in a bit of an existential crisis when they realise that without existence action is impossible, so they panic and crash. Trouble is, there is no good reason these things shouldn’t have disappeared - it should have been taken care of automatically by the Cocoa frameworks.

UPDATE: I’ve added some error checking, so that now Scrivener spews an error message in such situations and refuses to allow you to open the project. The way Scrivener is set up, it just can’t open read-only projects without lots of rewriting. Still, I have a feeling this is only a workaround and that this same crash will come and bite me on the bottom again in the future, under different circumstances…