{"action":"opened","issue":{"url":"https://api.github.com/repos/embark-framework/embark/issues/909","repository_url":"https://api.github.com/repos/embark-framework/embark","labels_url":"https://api.github.com/repos/embark-framework/embark/issues/909/labels{/name}","comments_url":"https://api.github.com/repos/embark-framework/embark/issues/909/comments","events_url":"https://api.github.com/repos/embark-framework/embark/issues/909/events","html_url":"https://github.com/embark-framework/embark/issues/909","id":363819710,"node_id":"MDU6SXNzdWUzNjM4MTk3MTA=","number":909,"title":"IfStatement without statements causes error in coverage/contract_source.js","user":{"login":"hodlbank","id":29763583,"node_id":"MDQ6VXNlcjI5NzYzNTgz","avatar_url":"https://avatars0.githubusercontent.com/u/29763583?v=4","gravatar_id":"","url":"https://api.github.com/users/hodlbank","html_url":"https://github.com/hodlbank","followers_url":"https://api.github.com/users/hodlbank/followers","following_url":"https://api.github.com/users/hodlbank/following{/other_user}","gists_url":"https://api.github.com/users/hodlbank/gists{/gist_id}","starred_url":"https://api.github.com/users/hodlbank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hodlbank/subscriptions","organizations_url":"https://api.github.com/users/hodlbank/orgs","repos_url":"https://api.github.com/users/hodlbank/repos","events_url":"https://api.github.com/users/hodlbank/events{/privacy}","received_events_url":"https://api.github.com/users/hodlbank/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-26T01:02:11Z","updated_at":"2018-09-26T01:02:11Z","closed_at":null,"author_association":"NONE","body":"## Overview\r\nSolidity AST IfStatement without statements e.g.:\r\n`if(!owner.send(fundsComissionWei)) revert();`\r\ncauses error in coverage/contract_source.js \r\n\r\n### Extra Detail\r\n\r\nwarning.js:18 (node:910) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined\r\n    at ContractSource.generateCodeCoverage (/embark-framework-new/lib/modules/coverage/contract_source.js:167:38)\r\n    at ContractSources.generateCodeCoverage (/embark-framework-new/lib/modules/coverage/contract_sources.js:63:47)\r\n    at CodeCoverage.runSolc (/embark-framework-new/lib/modules/coverage/index.js:66:50)\r\n    at <anonymous>\r\n\r\nLine 167 in the contract_source.js :\r\n`if(node.trueBody.statements[0]) {`\r\n\r\nFor solidity line \r\n`if(!owner.send(fundsComissionWei)) revert();`\r\n\r\nnode.trueBody does not have property statements, it has nodeType=\"ExpressionStatement\" and looks like this:\r\n```\r\n// node.trueBody\r\nexpression:\r\nargumentTypes: null\r\narguments: []\r\nexpression: {argumentTypes: Array(0), id: 3218, name: \"revert\", nodeType: \"Identifier\", overloadedDeclarations: Array(0), …}\r\nid: 3219\r\nisConstant: false\r\nisLValue: false\r\nisPure: false\r\nkind: \"functionCall\"\r\nlValueRequested: false\r\nnames: []\r\nnodeType: \"FunctionCall\"\r\nsrc: \"29142:8:4\"\r\ntypeDescriptions: {typeIdentifier: \"t_tuple$__$\", typeString: \"tuple()\"}\r\n__proto__: Object\r\nid: 3220\r\nnodeType: \"ExpressionStatement\"\r\nsrc: \"29142:8:4\"\r\n```\r\n\r\n#### Context (Environment)\r\n* OS: Ubuntu 16.04\r\n* Embark Version: develop/b24449d1cdf0af8e283c87daf70cac587085a6bf (Mon Sep 24 17:10:44 2018)\r\n* Node Version: v8.12.0\r\n* NPM Version: 6.4.1\r\n\r\n"}}
{"actor":{"display_login":"hodlbank"}}