Fix undefined image bug

This commit is contained in:
jpellizzari
2017-11-13 09:30:04 -08:00
parent c5bdebdffe
commit 723d47170e

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);