Skip to content

Commit

Permalink
Fix possible crash in the New Object Dialog (#5968)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau authored Nov 28, 2023
1 parent 9718fb7 commit 6cd8f54
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 6cd8f54

Please sign in to comment.