Skip to content

Commit c09d2ae

Browse files
authored
Merge pull request #3032 from devtron-labs/fix/misc-sentry-null
fix: misc sentry null fix
2 parents b48d091 + 536503a commit c09d2ae

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

src/Pages/App/CreateAppModal/UpdateTemplateConfig.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,19 @@ const UpdateTemplateConfig = ({
6969
}
7070

7171
const handleCIConfigParentStateUpdate: CIConfigProps['setParentState'] = (updatedParentStateOrHandler) => {
72-
const {
73-
ciConfig: { dockerRegistry, dockerRepository },
74-
} = updatedParentStateOrHandler
72+
if (updatedParentStateOrHandler?.ciConfig) {
73+
const {
74+
ciConfig: { dockerRegistry, dockerRepository },
75+
} = updatedParentStateOrHandler
7576

76-
handleFormStateChange({
77-
action: CreateAppFormStateActionType.updateBuildConfiguration,
78-
value: {
79-
dockerRegistry,
80-
dockerRepository,
81-
},
82-
})
77+
handleFormStateChange({
78+
action: CreateAppFormStateActionType.updateBuildConfiguration,
79+
value: {
80+
dockerRegistry,
81+
dockerRepository,
82+
},
83+
})
84+
}
8385
}
8486

8587
const handleGitMaterialsChange: MaterialListProps['handleGitMaterialsChange'] = (updatedGitMaterial, isError) => {

src/components/app/details/triggerView/BuildImageModal/GitInfoMaterial.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const GitInfoMaterial = ({
154154
)
155155
// Not added source not configured check here since ideally this should not be even called at that moment and we are not adding a new material
156156

157-
if (!newSelectedMaterialItem.result.length) {
157+
if (!newSelectedMaterialItem.result?.length) {
158158
throw new Error('Unable to fetch material details')
159159
}
160160

@@ -209,17 +209,17 @@ const GitInfoMaterial = ({
209209
updatedMaterialKeys.history = [
210210
{
211211
commitURL: selectedMaterial.gitURL
212-
? createGitCommitUrl(selectedMaterial.gitURL, commitHistoryResult.Commit)
212+
? createGitCommitUrl(selectedMaterial.gitURL, commitHistoryResult?.Commit)
213213
: '',
214-
commit: commitHistoryResult.Commit || '',
215-
author: commitHistoryResult.Author || '',
216-
date: commitHistoryResult.Date ? handleUTCTime(commitHistoryResult.Date, false) : '',
217-
message: commitHistoryResult.Message || '',
218-
changes: commitHistoryResult.Changes || [],
214+
commit: commitHistoryResult?.Commit || '',
215+
author: commitHistoryResult?.Author || '',
216+
date: commitHistoryResult?.Date ? handleUTCTime(commitHistoryResult.Date, false) : '',
217+
message: commitHistoryResult?.Message || '',
218+
changes: commitHistoryResult?.Changes || [],
219219
showChanges: true,
220-
webhookData: commitHistoryResult.WebhookData,
221-
isSelected: !commitHistoryResult.Excluded,
222-
excluded: commitHistoryResult.Excluded,
220+
webhookData: commitHistoryResult?.WebhookData,
221+
isSelected: !commitHistoryResult?.Excluded,
222+
excluded: commitHistoryResult?.Excluded,
223223
},
224224
]
225225

0 commit comments

Comments
 (0)