forked from Mirrors/openclonk
Fix crash on invalid Editor.geometry (#1897)
parent
10ab981b6f
commit
2c3a770415
|
@ -172,12 +172,20 @@ void C4ConsoleQtMainWindow::LoadGeometry()
|
||||||
StdBuf ws_contents;
|
StdBuf ws_contents;
|
||||||
if (ws_contents.LoadFromFile(Config.AtUserDataPath(C4CFN_EditorGeometry)))
|
if (ws_contents.LoadFromFile(Config.AtUserDataPath(C4CFN_EditorGeometry)))
|
||||||
{
|
{
|
||||||
EditorWindowState ws;
|
try
|
||||||
CompileFromBuf<StdCompilerBinRead>(ws, ws_contents);
|
{
|
||||||
QByteArray geometry(static_cast<const char *>(ws.geometry.getData()), ws.geometry.getSize()),
|
EditorWindowState ws;
|
||||||
window_state(static_cast<const char *>(ws.window_state.getData()), ws.window_state.getSize());
|
CompileFromBuf<StdCompilerBinRead>(ws, ws_contents);
|
||||||
restoreGeometry(geometry);
|
QByteArray geometry(static_cast<const char *>(ws.geometry.getData()), ws.geometry.getSize()),
|
||||||
restoreState(window_state);
|
window_state(static_cast<const char *>(ws.window_state.getData()), ws.window_state.getSize());
|
||||||
|
restoreGeometry(geometry);
|
||||||
|
restoreState(window_state);
|
||||||
|
}
|
||||||
|
catch (StdCompiler::Exception *e)
|
||||||
|
{
|
||||||
|
Log("Editor: Could not restore window settings");
|
||||||
|
delete e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue