forked from Mirrors/openclonk
Fix crash on invalid Editor.geometry (#1897)
parent
10ab981b6f
commit
2c3a770415
|
@ -171,6 +171,8 @@ void C4ConsoleQtMainWindow::LoadGeometry()
|
||||||
// Restore window settings from file
|
// Restore window settings from file
|
||||||
StdBuf ws_contents;
|
StdBuf ws_contents;
|
||||||
if (ws_contents.LoadFromFile(Config.AtUserDataPath(C4CFN_EditorGeometry)))
|
if (ws_contents.LoadFromFile(Config.AtUserDataPath(C4CFN_EditorGeometry)))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
EditorWindowState ws;
|
EditorWindowState ws;
|
||||||
CompileFromBuf<StdCompilerBinRead>(ws, ws_contents);
|
CompileFromBuf<StdCompilerBinRead>(ws, ws_contents);
|
||||||
|
@ -179,6 +181,12 @@ void C4ConsoleQtMainWindow::LoadGeometry()
|
||||||
restoreGeometry(geometry);
|
restoreGeometry(geometry);
|
||||||
restoreState(window_state);
|
restoreState(window_state);
|
||||||
}
|
}
|
||||||
|
catch (StdCompiler::Exception *e)
|
||||||
|
{
|
||||||
|
Log("Editor: Could not restore window settings");
|
||||||
|
delete e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void C4ConsoleQtMainWindow::PlayPressed(bool down)
|
void C4ConsoleQtMainWindow::PlayPressed(bool down)
|
||||||
|
|
Loading…
Reference in New Issue