Merge pull request #2258 from iminoso/builds-null-check
Check for null data on builds table
This commit is contained in:
commit
82542619a3
1 changed files with 12 additions and 3 deletions
|
@ -26,12 +26,21 @@ export default class Build extends React.Component<any, any> {
|
|||
);
|
||||
});
|
||||
let buildId: string = element.id.split('-')[0];
|
||||
let phase: string = element.phase ? element.phase : 'Cannot retrieve phase';
|
||||
let started: string = element.started ? element.started : 'Cannot retrieve start date';
|
||||
let message: string;
|
||||
if (element.trigger_metadata && element.trigger_metadata.commit_info && element.trigger_metadata.commit_info.message){
|
||||
message = element.trigger_metadata.commit_info.message;
|
||||
}
|
||||
else {
|
||||
message = 'Cannot retrieve message';
|
||||
}
|
||||
buildsTable.push(
|
||||
<tr key={buildId}>
|
||||
<td>{element.phase}</td>
|
||||
<td>{phase}</td>
|
||||
<td>{buildId}</td>
|
||||
<td>{element.trigger_metadata.commit_info.message}</td>
|
||||
<td>{moment(element.started).format('l')}</td>
|
||||
<td>{message}</td>
|
||||
<td>{moment(started).format('l')}</td>
|
||||
<td>{tags}</td>
|
||||
</tr>
|
||||
)
|
||||
|
|
Reference in a new issue