mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 05:08:35 -07:00
Temp fix menu edge case crash in esubghz chat
This commit is contained in:
@@ -70,7 +70,7 @@ uint8_t icon_animation_get_height(const IconAnimation* instance) {
|
||||
void icon_animation_start(IconAnimation* instance) {
|
||||
furi_check(instance);
|
||||
|
||||
if(!instance->animating && instance->icon->frame_rate && instance->icon->frame_count > 1) {
|
||||
if(!instance->animating) {
|
||||
instance->animating = true;
|
||||
furi_assert(instance->icon->frame_rate);
|
||||
furi_check(
|
||||
|
||||
@@ -498,9 +498,14 @@ static void menu_exit(void* context) {
|
||||
menu->view,
|
||||
MenuModel * model,
|
||||
{
|
||||
MenuItem* item = MenuItemArray_get(model->items, model->position);
|
||||
if(item && item->icon) {
|
||||
icon_animation_stop(item->icon);
|
||||
// If menu_reset() is called before view exit, model->items is reset
|
||||
// But for some reason, even with size 0, array get() returns a non-null pointer?
|
||||
// MLIB docs have no mention of out of bounds condition, seems weird
|
||||
if(model->position < MenuItemArray_size(model->items)) {
|
||||
MenuItem* item = MenuItemArray_get(model->items, model->position);
|
||||
if(item && item->icon) {
|
||||
icon_animation_stop(item->icon);
|
||||
}
|
||||
}
|
||||
},
|
||||
false);
|
||||
|
||||
Reference in New Issue
Block a user