Fix NPE from startNewTransition

With shell transition, the token can be null from
WindowOrganizerController#startNewTransition.
E.g. entering split screen.

Bug: 258913831
Test: atest TransitionTests
Change-Id: I77e85c4a340a88056c8188f5da99cf57bf52197e
This commit is contained in:
Riddle Hsu
2022-11-30 18:15:24 +08:00
parent b18b7e97ce
commit 4733e7031a

View File

@@ -228,7 +228,8 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
}
@Nullable
static Transition fromBinder(@NonNull IBinder token) {
static Transition fromBinder(@Nullable IBinder token) {
if (token == null) return null;
try {
return ((Token) token).mTransition.get();
} catch (ClassCastException e) {