Merge pull request #2934 from weaveworks/1449-image-details-undefined

Fix undefined image bug
This commit is contained in:
Jordan Pellizzari
2017-11-14 07:49:46 -08:00
committed by GitHub

View File

@@ -10,13 +10,17 @@ import { getImagesForService } from '../../actions/app-actions';
const topologyWhitelist = ['kube-controllers'];
function newImagesAvailable(images, currentId) {
// Assume that the current image is always in the list of all available images.
// Should be a safe assumption...
const current = find(images, i => i.ID === currentId);
const timestamp = new Date(current.CreatedAt);
return !isNull(find(images, i => timestamp < new Date(i.CreatedAt)));
if (current) {
const timestamp = new Date(current.CreatedAt);
return !isNull(find(images, i => timestamp < new Date(i.CreatedAt)));
}
return false;
}
class NodeDetailsImageStatus extends React.PureComponent {
constructor(props, context) {
super(props, context);