Skip to content

Commit 7164cab

Browse files
committed
handle null image vendor
1 parent 2f1ae4e commit 7164cab

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/features/linodes/ListLinodes/LinodeCard.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import ContentCopyIcon from 'material-ui-icons/ContentCopy';
1616

1717
import CallToAction from 'material-ui-icons/CallToAction';
1818
import Replay from 'material-ui-icons/Replay';
19+
import CloudCircle from 'material-ui-icons/CloudCircle';
1920

2021
import ActionMenu from 'src/components/ActionMenu';
2122
import Tag from 'src/components/Tag';
@@ -117,7 +118,10 @@ class LinodeCard extends React.Component<Props & WithStyles<CSSClasses> > {
117118
<div className={classes.cardSection}>
118119
<Grid container>
119120
<Grid item className="tac" xs={2}>
120-
<img src={distroIcons[image.vendor]} className={classes.distroIcon}/>
121+
{image.vendor ?
122+
<img src={distroIcons[image.vendor]} className={classes.distroIcon}/>
123+
: <CloudCircle className={classes.distroIcon} />
124+
}
121125
</Grid>
122126
<Grid item xs={9}>
123127
<Typography variant="subheading">

src/store/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ const defaultState: Linode.AppState = {
507507
created_by: 'linode',
508508
deprecated: false,
509509
id: 'linode/Ubuntu16.04LTS',
510-
vendor: 'Ubuntu',
510+
vendor: null,
511511
size: 800,
512512
type: 'manual',
513513
created: '2016-04-22T18:11:29',

src/types/Image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Linode {
88
is_public: Boolean;
99
size: number;
1010
created_by: string;
11-
vendor: string;
11+
vendor: string | null;
1212
deprecated: Boolean;
1313
}
1414

0 commit comments

Comments
 (0)