Avoid invalid access to Optional

If the UI is not ok, the exit status of the client might not be
available. Return -1 in that case.
This commit is contained in:
Maxime Coste 2018-07-30 10:32:38 +01:00
parent d2509e54f2
commit 075d1048ab

View File

@ -563,7 +563,7 @@ int run_client(StringView session, StringView name, StringView client_init,
raise(SIGTSTP);
while (not client.exit_status() and client.is_ui_ok())
event_manager.handle_next_events(EventMode::Normal);
return *client.exit_status();
return client.exit_status().value_or(-1);
}
catch (disconnected& e)
{