Просмотр исходного кода

Fix and improve switch camera and its error handling

Kristian Vos 10 месяцев назад
Родитель
Сommit
98108a7f74
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/main.c

+ 1 - 1
src/main.c

@@ -730,7 +730,7 @@ static void
 run_camera_switch_action(GSimpleAction *action, GVariant *param, gpointer user_data)
 {
         int new_index = state.camera->index + 1;
-        if (new_index > state.configuration->count) {
+        if (new_index > state.configuration->count - 1 || new_index < 0) {
                 new_index = 0;
         }