From f133aebfaf6259c14f96dcbdbce2d9358fdde562 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 25 Jul 2018 00:37:48 +0200 Subject: Fixed the relative resolver not checking if the file can be read in the first place --- packages/sol-resolver/src/resolvers/relative_fs_resolver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') 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, -- cgit From 9199a56b7ae8e8cffd02b8e79e9e827356975c63 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Fri, 27 Jul 2018 15:20:24 +0200 Subject: Added fix to CHANGELOG --- packages/sol-resolver/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages') diff --git a/packages/sol-resolver/CHANGELOG.md b/packages/sol-resolver/CHANGELOG.md index 742feb165..3724f8e40 100644 --- a/packages/sol-resolver/CHANGELOG.md +++ b/packages/sol-resolver/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v1.0.2 - ??? + + * Fix a bug where RelativeFSResolver would crash when trying to read a directory + ## v1.0.1 - _July 23, 2018_ * Dependencies updated -- cgit