@@ -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