Skip to content

Commit 283e52d

Browse files
committed
Merge branch 'develop'
2 parents 400ff5d + aaa83b5 commit 283e52d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

app/client/lib/helpers/helperFunctions.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ Helpers.getDefaultContractExample = function(withoutPragma) {
2323
if (withoutPragma) {
2424
return source;
2525
} else {
26-
solcVersion = mist.solidity.version || '0.4.6'; // Keep this for now as the Mist-API object will only be availabe from Mist version >= 0.8.9 so that older versions that will query code from wallet.ethereum.org won't use broken example code.
26+
var solcVersion;
27+
28+
// Keep this for now as the Mist-API object will only be availabe from Mist version >= 0.8.9
29+
// so that older versions that will query code from wallet.ethereum.org won't use broken example code.
30+
if (typeof mist !== 'undefined' && mist.solidity && mist.solidity.version) {
31+
solcVersion = mist.solidity.version;
32+
}
33+
else {
34+
solcVersion = '0.4.6';
35+
}
2736
return 'pragma solidity ' + solcVersion + ';\n\n' + source;
2837
}
2938
}

0 commit comments

Comments
 (0)