Skip to content

Commit

Permalink
fix: Remove null or duplicate app entries from suggest_app_for_fsentry()
Browse files Browse the repository at this point in the history
  • Loading branch information
AtkinsSJ committed May 17, 2024
1 parent c55b1e4 commit 6900233
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/backend/src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,15 @@ async function suggest_app_for_fsentry(fsentry, options){
monitor.end();

// return list
return suggested_apps;
return suggested_apps.filter((suggested_app, pos, self) => {
// Remove any null values caused by calling `get_app()` for apps that don't exist.
// This happens on self-host because we don't include `code`, among others.
if (!suggested_app)
return false;

// Remove any duplicate entries
return self.indexOf(suggested_app) === pos;
});
}

function build_item_object(item){
Expand Down

0 comments on commit 6900233

Please sign in to comment.