Merge pull request #235 from chaigler/fix_gui_editor_crash

Fix crash due to GuiEditCanvas::save()
This commit is contained in:
Brian Roberts 2020-07-02 16:23:59 -05:00 committed by GitHub
commit aa897d0242
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -436,7 +436,13 @@ function GuiEditCanvas::save( %this, %selectedOnly, %noPrompt )
%fileObject.delete();
%fo = new FileObject();
%fo.openForWrite(%filename);
if(!%fo.openForWrite(%filename))
{
error("GuiEditCanvas::save() - Unable to save, file location not open for writing.");
%fo.close();
return false;
}
// Write out the captured TorqueScript that was before the object before the object
for( %i = 0; %i <= %beforeLines; %i++)