From 8959b0993e92d86fdf8539d11d4e4c70185eb8ed Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 15 Aug 2018 13:38:41 -0700 Subject: raise error for unknown compiler version --- packages/sol-compiler/src/compiler.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/sol-compiler/src/compiler.ts') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index ff3805073..9a6dcff09 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -85,6 +85,9 @@ export class Compiler { private static async _getSolcAsync( solcVersion: string, ): Promise<{ solcInstance: solc.SolcInstance; fullSolcVersion: string }> { + if (_.isUndefined(binPaths[solcVersion])) { + throw new Error(`${solcVersion} is not a known compiler version`); + } const fullSolcVersion = binPaths[solcVersion]; const compilerBinFilename = path.join(SOLC_BIN_DIR, fullSolcVersion); let solcjs: string; -- cgit