Browse Source

Terminal links: added check to avoid crash

merge-requests/365/head
eidheim 10 years ago
parent
commit
a379d147bd
  1. 4
      src/terminal.cc

4
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(); auto path_str=sm[1].str()+sm[2].str();
boost::system::error_code ec; boost::system::error_code ec;
auto path=boost::filesystem::canonical(path_str, ec); auto path=boost::filesystem::canonical(path_str, ec);
if(ec) if(ec) {
if(Project::current_language)
path=boost::filesystem::canonical(Project::current_language->build->get_default_build_path()/path_str, ec); path=boost::filesystem::canonical(Project::current_language->build->get_default_build_path()/path_str, ec);
}
if(!ec && boost::filesystem::is_regular_file(path)) { if(!ec && boost::filesystem::is_regular_file(path)) {
Notebook::get().open(path); Notebook::get().open(path);
if(Notebook::get().get_current_page()!=-1) { if(Notebook::get().get_current_page()!=-1) {

Loading…
Cancel
Save