ClonesTable: Ensure source exists before reading its account_id property
If a clone is created using a source, and the source is then deleted, the source will be undefined. Attempting to read the account_id from undefined causes the app to crash. Optional chaining fixes this.
This commit is contained in:
parent
b729edf152
commit
f0ae99b31e
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ const Row = ({ imageId }) => {
|
|||
if (isSuccess) {
|
||||
const accountId = awsSources.find(
|
||||
(source) => source.id === image.share_with_sources[0]
|
||||
).account_id;
|
||||
)?.account_id;
|
||||
return accountId;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue