diff options
author | Olaf Tomalka <olaf@tomalka.me> | 2018-07-25 06:37:48 +0800 |
---|---|---|
committer | Olaf Tomalka <olaf@tomalka.me> | 2018-07-25 06:37:48 +0800 |
commit | f133aebfaf6259c14f96dcbdbce2d9358fdde562 (patch) | |
tree | 897716f33436576cf11425138ba0b41e506440bd | |
parent | fac90c446cc3a79ffe57ae13c685e7555714cf23 (diff) | |
download | dexon-0x-contracts-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.gz dexon-0x-contracts-f133aebfaf6259c14f96dcbdbce2d9358fdde562.tar.zst dexon-0x-contracts-f133aebfaf6259c14f96dcbdbce2d9358fdde562.zip |
Fixed the relative resolver not checking if the file can be read in the
first place
-rw-r--r-- | packages/sol-resolver/src/resolvers/relative_fs_resolver.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts index 77103b8c1..ed96040d3 100644 --- a/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts +++ b/packages/sol-resolver/src/resolvers/relative_fs_resolver.ts @@ -14,7 +14,7 @@ export class RelativeFSResolver extends Resolver { // tslint:disable-next-line:prefer-function-over-method public resolveIfExists(importPath: string): ContractSource | undefined { const filePath = path.join(this._contractsDir, importPath); - if (fs.existsSync(filePath)) { + if (fs.existsSync(filePath) && !fs.lstatSync(filePath).isDirectory()) { const fileContent = fs.readFileSync(filePath).toString(); return { source: fileContent, |