Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Hammer crashes loading invalid VMFs

Open vrad-exe opened this issue 2 years ago • 2 comments

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

  1. Open invalid/corrupt VMF files, such as the ones in the below zip
  2. Hammer spits out an error that the file is invalid
  3. After dismissing the dialog, Hammer crashes

Issue Map

vmfs.zip

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

vrad-exe avatar Aug 16 '23 23:08 vrad-exe

This might be implemented? I remember trying to open a corrupt VMF sometime recently and having it not crash

vrad-exe avatar Mar 29 '24 21:03 vrad-exe

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.

ozxybox avatar Mar 30 '24 02:03 ozxybox

Closing this, as I believe this got improved. There's been no response for three months, and the issue was opened a year ago.

ozxybox avatar Jun 25 '24 00:06 ozxybox