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

fix(graphql) Fix null pointer exception when fetching entity aspect via graphql #5857

Conversation

chriscollins3456
Copy link
Collaborator

if you query for aspects on an entity with autoRenderAspects: false you end up getting a null pointer exception from the WeaklyTypedAspectsResolver. This fixes that.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

resultRenderSpec.setDisplayName(renderSpec.getString("displayName"));
resultRenderSpec.setKey(renderSpec.getString("key"));
result.setRenderSpec(resultRenderSpec);
}

results.add(result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the correct behavior when the renderSpec is null to still return the result in the list of results? or should this be in the null check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup I believe it's fair that it returns null for this piece if there is no renderSpec. It's already an optional field in case the aspect doesn't have a renderSpec

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay great thanks!

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

Unit Test Results (build & test)

517 tests  ±0   517 ✔️ ±0   8m 26s ⏱️ -2s
121 suites ±0       0 💤 ±0 
121 files   ±0       0 ±0 

Results for commit 49816dd. ± Comparison against base commit abddc01.

@chriscollins3456 chriscollins3456 merged commit 494f38e into datahub-project:master Sep 7, 2022
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Sep 8, 2022
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Sep 8, 2022
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

Successfully merging this pull request may close these issues.

2 participants