From a0512502049eca3f0351029db537f8b0b5e801c1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 24 Dec 2015 04:09:30 +0000 Subject: [PATCH] Do not try to access the local client if it was not succesfully created --- src/main.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.cc b/src/main.cc index 267eec23..6ac0fc70 100644 --- a/src/main.cc +++ b/src/main.cc @@ -507,12 +507,15 @@ int run_server(StringView session, StringView init_command, 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); - auto& selections = local_client->context().selections_write_only(); - auto& buffer = selections.buffer(); - selections = SelectionList(buffer, buffer.clamp(target_line)); + if (local_client) + { + auto& selections = local_client->context().selections_write_only(); + auto& buffer = selections.buffer(); + selections = SelectionList(buffer, buffer.clamp(target_line)); + } if (startup_error) local_client->print_status({