Skip to content

Commit

Permalink
Fix possible undefined iconFileName
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau committed Nov 27, 2023
1 parent 38651ed commit 4f22f5a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ const InstructionParametersEditor = React.forwardRef<
objectName
);

const iconFilename = instructionMetadata.getIconFilename();
// For some reason, iconFileName can sometimes be undefined. see https://github.com/4ian/GDevelop/issues/5958.
const iconFilename = instructionMetadata.getIconFilename() || '';
const shouldInvertGrayScale =
paletteType === 'dark' &&
(iconFilename.startsWith('data:image/svg+xml') ||
Expand All @@ -251,7 +252,7 @@ const InstructionParametersEditor = React.forwardRef<
<Column expand>
<Line alignItems="flex-start">
<img
src={instructionMetadata.getIconFilename()}
src={iconFilename}
alt=""
style={{
...styles.icon,
Expand Down

0 comments on commit 4f22f5a

Please sign in to comment.