diff --git a/js/src/abi/util/pad.js b/js/src/abi/util/pad.js
index a7d940431..5a6751a4f 100644
--- a/js/src/abi/util/pad.js
+++ b/js/src/abi/util/pad.js
@@ -46,7 +46,8 @@ function stringToBytes (input) {
if (isArray(input)) {
return input;
} else if (input.substr(0, 2) === '0x') {
- return input.substr(2).toLowerCase().match(/.{1,2}/g).map((value) => parseInt(value, 16));
+ const matches = input.substr(2).toLowerCase().match(/.{1,2}/g) || [];
+ return matches.map((value) => parseInt(value, 16));
} else {
return input.split('').map((char) => char.charCodeAt(0));
}
diff --git a/js/src/modals/DeployContract/deployContract.js b/js/src/modals/DeployContract/deployContract.js
index 257ede1f1..952217edc 100644
--- a/js/src/modals/DeployContract/deployContract.js
+++ b/js/src/modals/DeployContract/deployContract.js
@@ -119,6 +119,13 @@ export default class DeployContract extends Component {
onClick={ this.onClose } />
);
+ const closeBtn = (
+ }
+ label='Close'
+ onClick={ this.onClose } />
+ );
+
if (deployError) {
return cancelBtn;
}
@@ -135,17 +142,10 @@ export default class DeployContract extends Component {
];
case 1:
- return [
- cancelBtn
- ];
+ return [ closeBtn ];
case 2:
- return [
- }
- label='Close'
- onClick={ this.onClose } />
- ];
+ return [ closeBtn ];
}
}