UnigramDev/Unigram/copytext-null-formattedtext • e0fae49 • 1 files, +8/-0
Fix crash when copying an empty selection or an absent note
CopyText(XamlRoot, FormattedText) dereferenced its argument immediately, but its
callers pass values that are legitimately null: TextSelectionManager's
GetSelectedText returns null when nothing is selected, BlockQuote passes the
result of FormattedTextBlock.GetSelectedText, and ProfileHeader passes
UserFullInfo.Note, which is null when the contact has no note.
The method is async void, so the NullReferenceException was posted to the
dispatcher and terminated the app instead of being catchable.
Reported by crash telemetry on 12.9.0.0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#unigram
Post #20543
108