Skip to content

Commit 7be3353

Browse files
committed
Ensure that invalid used supplied input returns a proper message in compileStandardWrapper
1 parent ae091c0 commit 7be3353

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wrapper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ function setupMethods (soljson) {
116116
return formatFatalError('Invalid import callback supplied');
117117
}
118118

119-
input = JSON.parse(input);
119+
try {
120+
input = JSON.parse(input);
121+
} catch (e) {
122+
return formatFatalError('Invalid JSON supplied: ' + e.message);
123+
}
120124

121125
if (input['language'] !== 'Solidity') {
122126
return formatFatalError('Only Solidity sources are supported');

0 commit comments

Comments
 (0)