Skip to content

Commit

Permalink
Fix chatops search (#4130)
Browse files Browse the repository at this point in the history
# What this PR does

Added NPE guard to fix search issue on slack channels inside integration
  • Loading branch information
teodosii committed Mar 28, 2024
1 parent 38a418a commit b544a43
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ export const SlackConnector = (props: SlackConnectorProps) => {
// if there's any default channel id, put it first in the list
const defaultChannel = results.find((res) => res.id === defaultChannelId);
const newList = results.filter((channel) => channel.id !== defaultChannelId);
defaultChannel.display_name += ` (Default)`;
newList.unshift(defaultChannel);

if (defaultChannel) {
defaultChannel.display_name += ` (Default)`;
newList.unshift(defaultChannel);
}

return newList;
}

Expand Down

0 comments on commit b544a43

Please sign in to comment.