From fa44607bfb55cfca9d79378a99c432f78a1bc8ec Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 13 Sep 2021 10:57:48 +0200 Subject: [PATCH] Fix Error count in solidity compiler badge --- apps/solidity-compiler/src/app/compiler-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index eb28191fb6..8082002ff4 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -264,7 +264,7 @@ export const CompilerApiMixin = (Base) => class extends Base { ) }) } else { - const count = (data.errors ? data.errors.filter(error => error.severity === 'error').length : 0) + data.error ? 1 : 0 + const count = (data.errors ? data.errors.filter(error => error.severity === 'error').length : 0 + (data.error ? 1 : 0)) this.emit('statusChanged', { key: count, title: `compilation failed with ${count} error${count > 1 ? 's' : ''}`, type: 'error' }) } // Update contract Selection