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

AstNode.astParent is not set for ast root - mark that in return type #2712

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpollmeier
Copy link
Contributor

the ast root doesn't have a parent:

cpg.method.head.astParent.astParent.astParent.astParent.astParent

java.util.NoSuchElementException
  at io.shiftleft.Implicits$JavaIteratorDeco$.onlyChecked$extension(Implicits.scala:43)
  at io.shiftleft.semanticcpg.language.nodemethods.AstNodeMethods$.astParent$extension(AstNodeMethods.scala:69)
  ... 39 elided

n.b. this isn't quite mergeable yet - I'll adapt downstream usage after
hearing your feedback...

the ast root doesn't have a parent:
```
cpg.method.head.astParent.astParent.astParent.astParent.astParent

java.util.NoSuchElementException
  at io.shiftleft.Implicits$JavaIteratorDeco$.onlyChecked$extension(Implicits.scala:43)
  at io.shiftleft.semanticcpg.language.nodemethods.AstNodeMethods$.astParent$extension(AstNodeMethods.scala:69)
  ... 39 elided
```

n.b. this isn't quite mergeable yet - I'll adapt downstream usage after
hearing your feedback...
@mpollmeier mpollmeier requested review from ml86 and fabsx00 May 12, 2023 19:55
@mpollmeier
Copy link
Contributor Author

thanks @prabhu for bringing this up

@DavidBakerEffendi DavidBakerEffendi added bug Something isn't working compatibility Concerns fixing either upstream or downstream compatibility labels Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Concerns fixing either upstream or downstream compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants