[gnote/gnome-3-14] Fix crash when disabling note actions



commit 348e591beb2f9997f509144d6f57cb879b5436ba
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jan 11 19:56:24 2015 +0200

    Fix crash when disabling note actions
    
    Occurrs when synchronizing or when setting note to read only.
    Fixes Bug 742657.

 src/notewindow.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 7847289..d1242a3 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -617,7 +617,8 @@ namespace gnote {
     if(m_global_keys)
       m_global_keys->enabled(m_enabled);
     FOREACH(const Glib::RefPtr<Gtk::Action> & action, get_widget_actions()) {
-      if(Glib::RefPtr<NonModifyingNoteAction>::cast_dynamic(action) == 0) {
+      // A list includes empty actions to mark separators, non-modifying actions are always enabled
+      if(action != 0 && Glib::RefPtr<NonModifyingNoteAction>::cast_dynamic(action) == 0) {
         action->set_sensitive(enable);
       }
     }


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