Skip to content

Commit

Permalink
Fix array out of bounds in create group when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed May 18, 2024
1 parent d366342 commit 437d212
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scenes/scene_action_create_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ bool scene_action_create_group_on_event(void* context, SceneManagerEvent event)
if(!strcmp(app->temp_cstr, "")) {
return false;
}
Item* item = ItemArray_get(app->items_view->items, app->selected_item);

FuriString* current_path = furi_string_alloc();
path_extract_dirname(furi_string_get_cstr(item->path), current_path);
if(app->selected_item != EMPTY_ACTION_INDEX) {
Item* item = ItemArray_get(app->items_view->items, app->selected_item);
path_extract_dirname(furi_string_get_cstr(item->path), current_path);
} else {
furi_string_set(current_path, app->items_view->path);
}

FuriString* new_group_path = furi_string_alloc();
furi_string_printf(
Expand Down

0 comments on commit 437d212

Please sign in to comment.