Fix game mode crash: null-guard node in HandleEditEvent#23
Merged
Conversation
TextOutputAction::execute passes nullptr as the cause node to editOutput (ControlManager.cpp:212). This propagates through the OnEditEvent subscription to CGameModule::HandleEditEvent, which unconditionally dereferences node->offset() and crashes with EXC_BAD_ACCESS at address 0x54 (the offset of m_Offset within CDasherNode). This caused the 4th TestFlight crash on DasherApp build 32 (iPhone 14,2 / iOS 26.5) — user comment: 'Started game mode'. The crash fires when the first character is typed after entering game mode. Fix: return early if node is null. A null-node edit event carries no useful information for game-mode tracking (which needs the node offset to check whether the user typed the correct target character at the right position). Signed-off-by: will wade <willwade@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DasherApp build 32 on TestFlight hit a crash (1 of 4 total) when entering game mode:
User comment: "Started game mode". Crash fires when the first character is typed after entering game mode.
Root cause
TextOutputAction::execute(ControlManager.cpp:212) passesnullptras the cause node:This nullptr propagates through
OnEditEvent.Broadcast→CGameModule::HandleEditEvent. The game module then dereferencesnode->offset()unconditionally, crashing at address0x54(the offset ofm_OffsetwithinCDasherNodewhenthisis null):This is the normal character-typing path:
CSymbolNode::Do()→TextOutputAction::execute→editOutput(text, nullptr). Every regular character triggers it; the crash only manifests in game mode becauseHandleEditEventis the subscriber that actually dereferencesnode.Fix
Add a null guard at the top of
HandleEditEvent:A null-node edit event carries no useful information for game-mode tracking (which needs the node offset to verify the user typed the correct target character). Dropping it is safe.
1 insertion, 0 deletions. No API changes.
Verification
x3(thenodeparameter) was0x0000000000000000Related
The
TextOutputAction::executepassing nullptr is by design — actions don't have access to the triggering node. An alternative fix would be threading the node through the action system, but that's a much larger change for no user-visible benefit. The null guard inHandleEditEventis the right level.