[quadrapassel] Fixed Seg fault due to game object not being created, it was trying to start a new game with no game



commit 8704e0fbcd994df45f2492c58f6ac261bfeb382f
Author: John Ward <john johnward net>
Date:   Thu Jun 24 21:48:41 2021 +0100

    Fixed Seg fault due to game object not being created, it was trying to start a new game with no game 
object on a key press

 src/quadrapassel.vala | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/quadrapassel.vala b/src/quadrapassel.vala
index 1ef47fc..d2255f7 100644
--- a/src/quadrapassel.vala
+++ b/src/quadrapassel.vala
@@ -661,9 +661,12 @@ public class Quadrapassel : Gtk.Application
     {
         var keyval = upper_key (event.keyval);
 
-        if (game.game_over && keyval == upper_key (settings.get_int ("key-start")))
+        if (game != null)
         {
-            new_game();
+            if (game.game_over && keyval == upper_key (settings.get_int ("key-start")))
+            {
+                new_game();
+            }
         }
 
         if (game == null) {


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