Skip to content

Fix #2277: Prevent NullReferenceException when accessing table.controller#2335

Open
kellyelton wants to merge 1 commit intomasterfrom
oi/2277/null-controller-fix
Open

Fix #2277: Prevent NullReferenceException when accessing table.controller#2335
kellyelton wants to merge 1 commit intomasterfrom
oi/2277/null-controller-fix

Conversation

@kellyelton
Copy link
Copy Markdown
Member

Fixes #2277

This fix prevents the NullReferenceException that occurs when accessing when no controller is assigned to a table or group.

Changes:

  • Added null checks to both and properties
  • Returns instead of trying to create a from a null controller ID
  • Prevents the SystemError: Object reference not set to an instance of an object

Testing:

  • The fix ensures that returns gracefully when no controller is assigned
  • This matches the expected behavior in the OCTGN API where unset controllers should return None

Files Modified:

  • octgnFX/Octgn.JodsEngine/Scripting/PythonAPI.py
  • octgnFX/Octgn.JodsEngine/Scripting/Versions/3.1.0.0.py
  • octgnFX/Octgn.JodsEngine/Scripting/Versions/3.1.0.1.py
  • octgnFX/Octgn.JodsEngine/Scripting/Versions/3.1.0.2.py

@kellyelton kellyelton added the octgn-issue-bot PRs created by the OCTGN issue bot label Apr 1, 2026
@kellyelton
Copy link
Copy Markdown
Member Author

🔧 Fixed issue #2277: Prevent NullReferenceException when accessing table.controller

PR: #2335
Issue: #2277 - Calling table.controller throws NullReferenceException

Fix: Added null checks to Card.controller and Group.controller properties to prevent crashes when no controller is assigned. Returns None instead of throwing SystemError.

Status: PR opened and awaiting review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

octgn-issue-bot PRs created by the OCTGN issue bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling table.controller throws NullReferenceException

1 participant