We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75a4cee commit 2fa1cf2Copy full SHA for 2fa1cf2
pages/index.tsx
@@ -18,7 +18,10 @@ const Home: NextPage = () => {
18
setByteCode(() => data.byteCode);
19
setAbi(() => JSON.stringify(data.abi));
20
})
21
- .catch(console.error)
+ .catch(err => {
22
+ alert(err);
23
+ console.error(err);
24
+ })
25
.finally(() => {
26
button.disabled = false;
27
});
src/sol/compiler.ts
@@ -28,6 +28,10 @@ export const compile = (contractCode: string): Promise<ContractData[]> => {
28
worker.onmessage = function (e: any) {
29
const output = e.data.output;
30
const result = [];
31
+ if (!output.contracts) {
32
+ reject("Invalid source code");
33
+ return;
34
+ }
35
for (const contractName in output.contracts['contract']) {
36
const contract = output.contracts['contract'][contractName];
37
result.push({
0 commit comments