Do not try to access the local client if it was not succesfully created

This commit is contained in:
Maxime Coste 2015-12-24 04:09:30 +00:00
parent 4d230e4051
commit a051250204

View File

@ -507,12 +507,15 @@ int run_server(StringView session, StringView init_command,
if (not daemon) if (not daemon)
{ {
local_client = client_manager.create_client( local_client = client_manager.create_client(
create_local_ui(dummy_ui), get_env_vars(), init_command); create_local_ui(dummy_ui), get_env_vars(), init_command);
auto& selections = local_client->context().selections_write_only(); if (local_client)
auto& buffer = selections.buffer(); {
selections = SelectionList(buffer, buffer.clamp(target_line)); auto& selections = local_client->context().selections_write_only();
auto& buffer = selections.buffer();
selections = SelectionList(buffer, buffer.clamp(target_line));
}
if (startup_error) if (startup_error)
local_client->print_status({ local_client->print_status({