Skip to content

Commit

Permalink
Handle undefined metadata so tests dont break
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Aug 14, 2018
1 parent e9ac1b1 commit 5e6667c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/cells/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,10 +803,15 @@ export namespace CodeCell {
return OutputArea.execute(code, cell.outputArea, session, metadata)
.then(msg => {
model.executionCount = msg.content.execution_count;
model.metadata.set('timing.execute_reply_started', msg.metadata
.started as string);
model.metadata.set('timing.execute_reply_sent', msg.header
.date as string);
const started = msg.metadata.started as string;
if (started) {
model.metadata.set('timing.execute_reply_started', started);
}
const date = msg.header.date as string;
if (date) {
model.metadata.set('timing.execute_reply_sent', date);
}

return msg;
})
.catch(e => {
Expand Down

0 comments on commit 5e6667c

Please sign in to comment.