mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 12:18: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) {
|
void icon_animation_start(IconAnimation* instance) {
|
||||||
furi_check(instance);
|
furi_check(instance);
|
||||||
|
|
||||||
if(!instance->animating && instance->icon->frame_rate && instance->icon->frame_count > 1) {
|
if(!instance->animating) {
|
||||||
instance->animating = true;
|
instance->animating = true;
|
||||||
furi_assert(instance->icon->frame_rate);
|
furi_assert(instance->icon->frame_rate);
|
||||||
furi_check(
|
furi_check(
|
||||||
|
|||||||
@@ -498,9 +498,14 @@ static void menu_exit(void* context) {
|
|||||||
menu->view,
|
menu->view,
|
||||||
MenuModel * model,
|
MenuModel * model,
|
||||||
{
|
{
|
||||||
MenuItem* item = MenuItemArray_get(model->items, model->position);
|
// If menu_reset() is called before view exit, model->items is reset
|
||||||
if(item && item->icon) {
|
// But for some reason, even with size 0, array get() returns a non-null pointer?
|
||||||
icon_animation_stop(item->icon);
|
// 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);
|
false);
|
||||||
|
|||||||
Reference in New Issue
Block a user