diff libgui/src/m-editor/file-editor.cc @ 26080:13d11afc8122

fix crash after editor dialog about creation of non-existing file * file-editor.cc (request_open_file): assign nullptrto fileEditorTab after its deletion for later testing for valid editor tab before trying to restore breakpoints
author Torsten <mttl@mailbox.org>
date Thu, 15 Nov 2018 20:40:12 +0100
parents ecd86b8b8979
children 31739d91ee49
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Thu Nov 15 13:39:10 2018 -0500
+++ b/libgui/src/m-editor/file-editor.cc	Thu Nov 15 20:40:12 2018 +0100
@@ -1359,6 +1359,7 @@
                 else
                   {
                     delete fileEditorTab;
+                    fileEditorTab = nullptr;
 
                     if (QFile::exists (openFileName))
                       {
@@ -1432,7 +1433,8 @@
               {
                 // update breakpoint pointers, really show editor
                 // and the current editor tab
-                fileEditorTab->update_breakpoints ();
+                if (fileEditorTab)
+                  fileEditorTab->update_breakpoints ();
                 focus ();
                 emit file_loaded_signal ();
               }