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

[FL-2602] Infrared: Fix crash when messing with SD card (#1339)

* Fix crash after removing SD card and exiting
* Show an error if SD card was removed on Universal remote screen
Georgii Surkov 3 лет назад
Родитель
Сommit
9868a65c15

+ 1 - 0
applications/infrared/infrared_brute_force.c

@@ -99,6 +99,7 @@ bool infrared_brute_force_start(
         success = flipper_format_file_open_existing(brute_force->ff, brute_force->db_filename);
         success = flipper_format_file_open_existing(brute_force->ff, brute_force->db_filename);
         if(!success) {
         if(!success) {
             flipper_format_free(brute_force->ff);
             flipper_format_free(brute_force->ff);
+            brute_force->ff = NULL;
             furi_record_close("storage");
             furi_record_close("storage");
         }
         }
     }
     }

+ 1 - 1
applications/infrared/scenes/common/infrared_scene_universal_common.c

@@ -74,7 +74,7 @@ bool infrared_scene_universal_common_on_event(void* context, SceneManagerEvent e
                     infrared_play_notification_message(
                     infrared_play_notification_message(
                         infrared, InfraredNotificationMessageBlinkSend);
                         infrared, InfraredNotificationMessageBlinkSend);
                 } else {
                 } else {
-                    scene_manager_previous_scene(scene_manager);
+                    scene_manager_next_scene(scene_manager, InfraredSceneErrorDatabases);
                 }
                 }
                 consumed = true;
                 consumed = true;
             }
             }