-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent splitting on an undefined value #247
Conversation
|
||
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to use the chaining operator to check the values, but the linter prevents the use of this operator.
image.RepoDigests && image.RepoDigests.length
vs. image.RepoDigests?.length
The dependency "default": "^12.0.1"
would need to be updated, the latest version is 17.1.0 and the operator is supported from version 15. But this leads to a whole list of adjustments that would then have to be made. I am not sure how to handle this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to use as-is and skip the optional chaining due to support of older Node.js versions.
|
||
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ok to use as-is and skip the optional chaining due to support of older Node.js versions.
@saemik94 thanks, I'll land this change and it will follow with publishing a new npm version and a new docker image tag to Docker Hub. Thank you so much! ❤️ |
🎉 This PR is included in version 3.23.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Fixed a bug where the imageList.widget crashed, due to empty digest or tag on docker images.
Proposed Changes
Checklist