octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63437] Null pointer dereference in file-edito


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #63437] Null pointer dereference in file-editor-tab.cc
Date: Tue, 29 Nov 2022 02:36:23 -0500 (EST)

Follow-up Comment #2, bug #63437 (project octave):

Would it be better to fall back to the default value instead of throwing an
error in this case?

diff -r 7a0702b1d19c libgui/src/m-editor/file-editor-tab.cc
--- a/libgui/src/m-editor/file-editor-tab.cc    Mon Nov 28 19:56:21 2022 -0800
+++ b/libgui/src/m-editor/file-editor-tab.cc    Tue Nov 29 08:13:15 2022 +0100
@@ -272,7 +272,9 @@
       notice_settings (settings, true);
 
     // encoding, not updated with the settings
-    m_encoding = settings->value (ed_default_enc.key, "UTF-8").toString ();
+    m_encoding = settings
+                 ? settings->value (ed_default_enc.key, "UTF-8").toString ()
+                 : "UTF-8";
     m_enc_indicator->setText (m_encoding);
     // no changes in encoding yet
     m_new_encoding = m_encoding;



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63437>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]