From 372ed0224c53b7e65f130acd0466106a2d70dd49 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 28 Aug 2019 14:19:43 +0200 Subject: [PATCH 1/2] check for key is defined --- src/app/components/vertical-icons.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/vertical-icons.js b/src/app/components/vertical-icons.js index 5012e680069..072d1d9cd7f 100644 --- a/src/app/components/vertical-icons.js +++ b/src/app/components/vertical-icons.js @@ -48,7 +48,7 @@ export class VerticalIcons extends Plugin { const types = ['error', 'warning', 'success', 'info', ''] const fn = (status) => { if (!types.includes(status.type) && status.type) throw new Error(`type should be ${keys.join()}`) - if (!status.key) throw new Error(`status key should be defined`) + if (status.key === undefined) throw new Error(`status key should be defined`) if (typeof status.key === 'string' && (!keys.includes(status.key))) { throw new Error('key should contain either number or ' + keys.join()) From 2def63cc99a33fcfd35bc482d5904a58911e9ef8 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 29 Aug 2019 10:07:11 +0200 Subject: [PATCH 2/2] check for error list length and not existence --- src/app/tabs/compile-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 0108cf42f03..9a12a28ac27 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -114,7 +114,7 @@ class CompileTab extends ViewPlugin { if (success) { // forwarding the event to the appManager infra this.emit('compilationFinished', source.target, source, 'soljson', data) - if (data.errors) { + if (data.errors && data.errors.length > 0) { this.emit('statusChanged', { key: data.errors.length, title: `compilation finished successful with warning${data.errors.length > 1 ? 's' : ''}`,