From a379d147bd23a56bb33f40e59e32f882cba904e8 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 13 May 2016 12:23:59 +0200 Subject: [PATCH] Terminal links: added check to avoid crash --- src/terminal.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/terminal.cc b/src/terminal.cc index 764916f..c3321ab 100644 --- a/src/terminal.cc +++ b/src/terminal.cc @@ -357,8 +357,10 @@ bool Terminal::on_button_press_event(GdkEventButton* button_event) { auto path_str=sm[1].str()+sm[2].str(); boost::system::error_code ec; auto path=boost::filesystem::canonical(path_str, ec); - if(ec) - path=boost::filesystem::canonical(Project::current_language->build->get_default_build_path()/path_str, ec); + if(ec) { + if(Project::current_language) + path=boost::filesystem::canonical(Project::current_language->build->get_default_build_path()/path_str, ec); + } if(!ec && boost::filesystem::is_regular_file(path)) { Notebook::get().open(path); if(Notebook::get().get_current_page()!=-1) {