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



commit ef0df724e80ba82f5d38496e8bc0bcc564994a15
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 fba1172..c2a0d71 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -495,8 +495,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]