Skip to content

fix(AI): Add null checks for training orders and factory lookup#410

Open
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/ai-training-null-checks
Open

fix(AI): Add null checks for training orders and factory lookup#410
seer-by-sentry[bot] wants to merge 1 commit intomainfrom
seer/fix/ai-training-null-checks

Conversation

@seer-by-sentry
Copy link
Copy Markdown

Fixes CLIENT-44Z. The issue was that: Access violation in ThingTemplate::isEquivalentTo due to this pointer being invalid, likely from a use-after-free of a ThingTemplate object.

  • Added null check for 'order->m_thing' in 'AIPlayer::startTraining' to prevent dereferencing a null pointer.
  • Added null check for 'thing' parameter in 'AIPlayer::findFactory' to prevent dereferencing a null pointer.
  • Ensures robustness when AI attempts to train or find factories for invalid (null) unit templates.

This fix was generated by Seer in Sentry, triggered automatically. 👁️ Run ID: 12233138

Not quite right? Click here to continue debugging with Seer.

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.

0 participants