From 7638531d73c9060d7979285943d950b12c6544e8 Mon Sep 17 00:00:00 2001 From: David Disu Date: Mon, 18 Jul 2022 11:40:20 +0100 Subject: [PATCH] Fix checking undefined value --- apps/solidity-compiler/src/app/compiler-api.ts | 2 +- libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/solidity-compiler/src/app/compiler-api.ts b/apps/solidity-compiler/src/app/compiler-api.ts index 3065af630a..08bc50888e 100644 --- a/apps/solidity-compiler/src/app/compiler-api.ts +++ b/apps/solidity-compiler/src/app/compiler-api.ts @@ -298,7 +298,7 @@ export const CompilerApiMixin = (Base) => class extends Base { this.compilationDetails = { contractMap: {}, contractsDetails: {}, - target: source.target + target: source ? source.target : null } } if (this.onCompilationFinished) this.onCompilationFinished(this.compilationDetails) diff --git a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts index 06f51b9092..ef03092cb8 100644 --- a/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts +++ b/libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts @@ -18,7 +18,7 @@ export class OpenZeppelinProxy extends Plugin { async isConcerned(ast: ContractAST = {} as ContractAST): Promise { // check in the AST if it's an upgradable contract - const UUPSSymbol = ast.exportedSymbols[UUPS] ? ast.exportedSymbols[UUPS][0] : null + const UUPSSymbol = ast.exportedSymbols && ast.exportedSymbols[UUPS] ? ast.exportedSymbols[UUPS][0] : null if (UUPSSymbol) { this.kind = 'UUPS'