Skip to content

Fix NullPointerException in diagram layout methods#115

Merged
h-man2 merged 1 commit intomasterfrom
fix/diagram-layout-null-pointer-exception
Sep 25, 2025
Merged

Fix NullPointerException in diagram layout methods#115
h-man2 merged 1 commit intomasterfrom
fix/diagram-layout-null-pointer-exception

Conversation

@h-man2
Copy link
Contributor

@h-man2 h-man2 commented Sep 25, 2025

  • Fixed incorrect null check in 6 layout methods
  • Changed 'if (fLayouter == null)' to 'if (fAllLayoutTypes == null)'
  • Methods affected: HierarchicalLayout, HierarchicalUpsideDownLayout, HorizontalLayout, HorizontalRightToLeftLayout, LandscapeSwimlaneLayout, PortraitSwimlaneLayout
  • Resolves runtime error when calling layout methods on uninitialized diagrams

Fixes: Diagram layout NullPointerException when fAllLayoutTypes is null

- Fixed incorrect null check in 6 layout methods
- Changed 'if (fLayouter == null)' to 'if (fAllLayoutTypes == null)'
- Methods affected: HierarchicalLayout, HierarchicalUpsideDownLayout,
  HorizontalLayout, HorizontalRightToLeftLayout, LandscapeSwimlaneLayout,
  PortraitSwimlaneLayout
- Resolves runtime error when calling layout methods on uninitialized diagrams

Fixes: Diagram layout NullPointerException when fAllLayoutTypes is null
@h-man2 h-man2 requested a review from Copilot September 25, 2025 09:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a NullPointerException bug in diagram layout methods by correcting the null check condition. The issue was that six layout methods were checking fLayouter for null instead of fAllLayoutTypes, which caused runtime errors when attempting to layout uninitialized diagrams.

  • Fixed null check condition in 6 layout methods from fLayouter == null to fAllLayoutTypes == null
  • Prevents NullPointerException when calling layout methods on uninitialized diagrams

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@h-man2 h-man2 merged commit 9a940a6 into master Sep 25, 2025
1 check passed
@h-man2 h-man2 deleted the fix/diagram-layout-null-pointer-exception branch September 25, 2025 09:33
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