metherul / Automaton

The open modpack platform.
Other
58 stars 14 forks source link

Crash on Load of Bad .auto file #60

Open FeralRants opened 5 years ago

FeralRants commented 5 years ago

If you load a file that isn't actually a .auto file it crashes the program.

Was just wondering what the program would do if I changed a txt file to a .auto and obviously it doesn't like that. Crashes without any error message or anything. Don't know if this is helpful or not, but figured it was worth at least a report.

AustinHaugerud commented 5 years ago

@metherul From what I can tell this can be fixed by adding a catch block or properly bubbling the exception in ArchiveContents.cs concerning the call to ArchiveFactory::Open from SharpCompress.

Notice the throw statement here.

https://github.com/adamhathcock/sharpcompress/blob/4e5b70dbfa89ed10417072c47854031503c17d73/src/SharpCompress/Archives/ArchiveFactory.cs#L59

metherul commented 5 years ago

We can most likely wrap the call within Automaton with a try/catch block and then route it off to be shown by a non-fatal dialog handler.