Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'trim' of undefined #1

Open
ghost opened this issue Jan 29, 2019 · 0 comments
Open

Uncaught TypeError: Cannot read property 'trim' of undefined #1

ghost opened this issue Jan 29, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 29, 2019

When generating comments for a file with existing comments, the plugin throws uncaught exception.

Sample .sol file:

contract SolidityCommentFails {`
  //
  // Long Comment
  //
  function failsOnLongComments() {}
}

Exception:
Uncaught TypeError: Cannot read property 'trim' of undefined

TypeError: Cannot read property 'trim' of undefined
at ContractComment.hasComment (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/lib/contract/contract-comment.js:165:22)
at ContractComment.updateComment (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/lib/contract/contract-comment.js:46:16)
at ContractComment.insertComment (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/lib/contract/contract-comment.js:38:16)
at Object.visitors.(anonymous function) [as ContractDefinition] (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/index.js:52:25)
at visit (/home/nikolay/.atom/packages/solidity-comments/node_modules/solidity-parser-antlr/dist/index.js:106:30)
at /home/nikolay/.atom/packages/solidity-comments/node_modules/solidity-parser-antlr/dist/index.js:97:14
at Array.forEach ()
at visit (/home/nikolay/.atom/packages/solidity-comments/node_modules/solidity-parser-antlr/dist/index.js:96:10)
at Object.visit (/home/nikolay/.atom/packages/solidity-comments/node_modules/solidity-parser-antlr/dist/index.js:113:7)
at generate (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/index.js:43:33)
at generateCommentsFromText (/home/nikolay/.atom/packages/solidity-comments/node_modules/@nodefactory/solidity-comments-core/dist/index.js:28:10)
at Object.run (/home/nikolay/.atom/packages/solidity-comments/lib/atom-solidity-comments.js:29:25)
at HTMLElement.atomSolidityCommentsToggle (/home/nikolay/.atom/packages/solidity-comments/lib/atom-solidity-comments.js:19:51)
at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/static/:11:350055)
at KeymapManager.t.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/static/:11:1230760)
at KeymapManager.t.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/static/:11:1226894)
at WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/static/:11:285234)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants