Fixed the relative resolver not checking if the file can be read in the

first place
This commit is contained in:
Olaf Tomalka
2018-07-25 00:37:48 +02:00
parent fac90c446c
commit f133aebfaf

View File

@@ -14,7 +14,7 @@ export class RelativeFSResolver extends Resolver {
// tslint:disable-next-line:prefer-function-over-method // tslint:disable-next-line:prefer-function-over-method
public resolveIfExists(importPath: string): ContractSource | undefined { public resolveIfExists(importPath: string): ContractSource | undefined {
const filePath = path.join(this._contractsDir, importPath); 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(); const fileContent = fs.readFileSync(filePath).toString();
return { return {
source: fileContent, source: fileContent,