Hammer crashes loading invalid VMFs
Describe the bug
We've all gotten used to the fact that Hammer will crash if you try to make it load an invalid VMF, but when you actually stop and think about it, this probably shouldn't happen. Hammer does have an error handler dialog telling you what it thinks went wrong when loading the file, so it'd make more sense for it to just give up loading the file after this point, returning you to the empty gray window that appears when Hammer is first opened.
To Reproduce
- Open invalid/corrupt VMF files, such as the ones in the below zip
- Hammer spits out an error that the file is invalid
- After dismissing the dialog, Hammer crashes
Issue Map
Expected Behavior
As stated above, Hammer should give you the same error dialog telling you why it couldn't parse the file, then close the file and return to the default gray screen instead of crashing
Operating System
Tested on Windows 10
This might be implemented? I remember trying to open a corrupt VMF sometime recently and having it not crash
I believe VMF loading got some improvements to error handling around 6 months ago. Not sure if it solves the problems you had with these files though. Try em out and let me know what happens! Otherwise I’ll have to look into it at some point. Regardless, there’s some types of bad VMFs that we won’t be able to catch trivially, but something like syntax errors can definitely be caught and handled.
Closing this, as I believe this got improved. There's been no response for three months, and the issue was opened a year ago.