[gnome-boxes] wizard: fix critical when running wizard automatically from cli



commit 3e14f7feedc66624521e5b083b8634bce4fb008e
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date:   Wed Sep 5 17:53:45 2012 +0200

    wizard: fix critical when running wizard automatically from cli
    
    When running from CLI, with live media, the summary is not generated
    (machine is null after create()), current_row = 0, and
    append_customize() will end up with a critical since there is no row
    to append to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683417

 src/wizard.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index 8f8b0b5..04fcdf4 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -696,6 +696,10 @@ private class Boxes.Wizard: Boxes.UI {
         }
 
         public void append_customize_button (CustomizeFunc cutomize_func) {
+            // there is nothing to customize if review page is empty
+            if (current_row == 0)
+                return;
+
             var button = new Gtk.Button.with_mnemonic (_("C_ustomize..."));
             button.modify_fg (Gtk.StateType.NORMAL, get_color ("white"));
             table.attach_defaults (button, 2, 3, current_row - 1, current_row);



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