Skip to content

Commit 0385737

Browse files
authored
fix: Executions page crashes when it cannot find iconUrl (#1270)
## Problem Recently encountered an error in Plumber Admin where a user's executions page crashed with an error complaining about iconUrl. ## Solution Add optional chaining on iconUrl to avoid crashes and fallback to the fallback icon instead. ## Tests May not be easy to replicate, but do a sanity check that everything still works - [ ] Executions load properly - [ ] Execution steps load properly - [ ] Apps load properly in My Apps page - [ ] App icons are shown properly when choosing app on create step
1 parent 696d24a commit 0385737

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

packages/frontend/src/components/ExecutionStep/components/AppIconWithStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Box } from '@chakra-ui/react'
33
import AppIcon from '@/components/AppIcon'
44

55
interface AppIconWithStatusProps {
6-
iconUrl: string
6+
iconUrl?: string
77
appName: string
88
statusIcon: React.ReactElement
99
}

packages/frontend/src/components/ExecutionStep/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function ExecutionStep({
6969
<HStack p={4} alignItems="center" justifyContent="space-between">
7070
<HStack gap={2}>
7171
<AppIconWithStatus
72-
iconUrl={app.iconUrl}
72+
iconUrl={app?.iconUrl}
7373
appName={appName}
7474
statusIcon={statusIcon}
7575
/>

packages/frontend/src/components/FlowAppIcons/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function FlowAppIcons(props: FlowAppIconsProps) {
2121
<AppIcon
2222
name={firstStep.name}
2323
variant="rounded"
24-
url={firstStep.iconUrl}
24+
url={firstStep?.iconUrl}
2525
h={8}
2626
w={8}
2727
isTrigger={true}
@@ -35,7 +35,7 @@ export default function FlowAppIcons(props: FlowAppIconsProps) {
3535
<AppIcon
3636
name={lastStep.name}
3737
variant="rounded"
38-
url={lastStep.iconUrl}
38+
url={lastStep?.iconUrl}
3939
h={8}
4040
w={8}
4141
/>

packages/frontend/src/components/FlowStepConfigurationModal/ChooseAndAddConnection/ConnectionHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function ConnectionHeader(props: ConnectionHeaderProps) {
4343
<Flex justifyContent="center" alignItems="center" gap={2} mt={2}>
4444
<AppLogoBox imageUrl={mainLogo} />
4545
<Icon as={BiTransferAlt} boxSize={6} color="base.content.default" />
46-
<AppLogoBox imageUrl={selectedApp.iconUrl} />
46+
<AppLogoBox imageUrl={selectedApp?.iconUrl} />
4747
</Flex>
4848
<Text textStyle="h4">{headerText}</Text>
4949
</Flex>

packages/frontend/src/components/FlowStepConfigurationModal/ChooseAppAndEvent/ChooseApp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export default function ChooseApp(props: ChooseAppProps) {
319319
>
320320
<Flex alignItems="center" gap={4}>
321321
<Image
322-
src={app.iconUrl}
322+
src={app?.iconUrl}
323323
boxSize={8}
324324
borderStyle="solid"
325325
fit="contain"

packages/frontend/src/pages/Application/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export default function Application(): React.ReactElement | null {
6060
<>
6161
<Container>
6262
<Flex gap={4} mb={3} px={4} alignItems="center">
63-
<AppIcon url={app.iconUrl} color={app.primaryColor} name={app.name} />
63+
<AppIcon
64+
url={app?.iconUrl}
65+
color={app.primaryColor}
66+
name={app.name}
67+
/>
6468
<Text textStyle="h4">{app.name}</Text>
6569
</Flex>
6670

0 commit comments

Comments
 (0)