Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • S Storage
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 47
    • Issues 47
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Open Subsurface Data Universe Software
  • Platform
  • System
  • Storage
  • Merge requests
  • !130

Merged
Created Jan 25, 2021 by Sherman Yang@syangMaintainer

fix null pointer exception when ancestry is empty

  • Overview 7
  • Commits 5
  • Pipelines 15
  • Changes 2

This MR fixes a subtle null pointer exception which could occur in the follow line: !record.getAncestry().getParents().isEmpty()) when the ancestry has no parent. The getParents() would return null. The next call isEmpty() would cause a null pointer exception when called on the returned null parents object.

The fix is to replace the line with the following line: !Collections.isEmpty(record.getAncestry().getParents())) Now if the getParents() method returns null, the Collections.isEmpty(null) call will correctly return true instead of null pointer exception as expected.

Corresponding unit tests have been updated accordingly.

Edited Apr 02, 2021 by Sherman Yang
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix_null_pointer