[chronojump] Fix crash on preferences when using a db on a system with "lower" camera detection



commit b7f2f6b6445e4dead18c431e580e7d911701469e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu May 5 16:23:56 2016 +0200

    Fix crash on preferences when using a db on a system with "lower" camera detection

 src/gui/preferences.cs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 6e01430..d525c7b 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -329,7 +329,11 @@ public class PreferencesWindow {
                UtilGtk.ComboUpdate(combo_camera, devices, "");
                hbox_combo_camera.PackStart(combo_camera, true, true, 0);
                hbox_combo_camera.ShowAll();
-               combo_camera.Active = UtilGtk.ComboMakeActive(devices, devices[current]);
+
+               if(current < devices.Length)
+                       combo_camera.Active = UtilGtk.ComboMakeActive(devices, devices[current]);
+               else
+                       combo_camera.Active = UtilGtk.ComboMakeActive(devices, 0);
        }
 
        // ---- Language stuff


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