Fix NPE in KeyboardVisibilityListener when userInfo is nil#2694
Open
onseok wants to merge 1 commit intoJetBrains:jb-mainfrom
Open
Fix NPE in KeyboardVisibilityListener when userInfo is nil#2694onseok wants to merge 1 commit intoJetBrains:jb-mainfrom
onseok wants to merge 1 commit intoJetBrains:jb-mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
f83ed2b to
a9d225f
Compare
When a keyboard notification is posted without userInfo (e.g., manually from native iOS code), the animationOptions property crashes due to unsafe cast. This change adds null-safe handling consistent with duration and endFrame properties in the same file. Fixes https://youtrack.jetbrains.com/issue/CMP-9548
a9d225f to
6aa8c5d
Compare
|
There is a conflict in the code review. As far as I see the bug already was fixed. |
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.
Description
Fix NullPointerException in
KeyboardVisibilityListenerwhen a keyboard notification is posted withoutuserInfo.Problem
When native iOS code manually posts a keyboard notification without
userInfo(e.g.,NotificationCenter.default.post(name: UIKeyboardWillHideNotification, object: nil)), theanimationOptionsproperty crashes due to an unsafe cast.The current implementation:
When userInfo is nil, value becomes null, and casting null to
UIViewAnimationOptionsthrows a NullPointerException.Crash stack trace
Solution
Add null-safe handling with a default value, consistent with the duration and endFrame properties in the same file.
Fixes https://youtrack.jetbrains.com/issue/CMP-9548
Testing
Release Notes
Fixes - iOS
Google CLA
Sign the Google Contributor's License Agreement at https://cla.developers.google.com to let us upstream your code to Google's AOSP repository