[gnome-calculator/gnome-3-12] fixes segmentation fault error on repeatedly clicking undo



commit fbd9eb408901c8d246e54ab44cbe3ef14f93568e
Author: elitalobo <loboelita gmail com>
Date:   Tue Jun 17 00:16:09 2014 +0530

    fixes segmentation fault error on repeatedly clicking undo

 src/math-equation.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/math-equation.vala b/src/math-equation.vala
index 160d923..eca91f6 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -487,8 +487,14 @@ public class MathEquation : Gtk.SourceBuffer
         status = ("");
         undo_stack.remove (state);
         redo_stack.prepend (get_current_state ());
-        state.ans = undo_stack.nth_data (0).ans;
 
+        if (undo_stack == null)
+        {
+            apply_state (state);
+            return;
+        }
+
+        state.ans = undo_stack.nth_data (0).ans;
         apply_state (state);
     }
 


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