Skip to content

Commit

Permalink
fix: prevent splitting on an undefined value (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
saemik94 authored Jul 19, 2023
1 parent 3f6ec5e commit a09177d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widgets/images/imageList.widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class myWidget extends ListWidget {

if (images) {
images.forEach((image) => {
const getTag = (tag, part) => tag ? tag[0].split(':')[part] : 'none'
const getTag = (tag, part) => (tag && tag.length) ? tag[0].split(':')[part] : 'none'

imageList.push([
image.Id.substring(7, 12),
image.RepoDigests ? image.RepoDigests[0].split('@')[0] : getTag(image[2], 0),
(image.RepoDigests && image.RepoDigests.length) ? image.RepoDigests[0].split('@')[0] : getTag(image[2], 0),
getTag(image.RepoTags, 1),
this.timeDifference(image.Created),
this.formatBytes(image.Size)
Expand Down

0 comments on commit a09177d

Please sign in to comment.