Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI editor crashes engine when attempting to save outside of the program directory. #2

Closed
lukaspj opened this issue May 30, 2020 · 0 comments · Fixed by #235
Closed

Comments

@lukaspj
Copy link
Contributor

lukaspj commented May 30, 2020

This issue was created in the GarageGames Repository (Link to original issue).
The issue was originally created by @chaigler and had a total of 0 comments that may contain additional information. The original issue description is pasted below:

This is on Windows, although something similar may happen on Mac and Linux. May also affect the mission editor (I haven't tried that yet).

If you attempt to save a GUI to a location outside of the main program directory the engine will crash and point to Stream::_write() with a 'Read Access Violation: this was nullptr' error. This occurs because the FileObject used in GuiEditCanvas::save() fails to open the location for writing (unless you're running the program as an admin/have elevated permissions) and the save() method doesn't check its return value to make sure it can actually write the data.

I've patched this in my repo by simply checking the return val & exiting the save() method early if it's false (around line 439 in guiEditorCanvas.ed.cs):

if(!%fo.openForWrite(%filename))
{
    error("GuiEditCanvas::save() - Unable to save, file location not open for writing.");
    %fo.close();
         
    return false;
}
      
Azaezel referenced this issue in Azaezel/Torque3D-1 Sep 2, 2021
BugFix: Corrections for script files in TSNeo
Eikelenboom referenced this issue in Eikelenboom/Torque3d-UI-MakeOver Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant