mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Add null-check to PlayerView to avoid NPE in edit mode
Previously we assumed that `surfaceSyncGroupV34` was always non-null on API 34, but this isn't true in edit mode. Instead we add an explicit null-check before accessing it. We don't need to null-check it at the other usage site because we are already null-checking `surfaceView` (via `instanceof` check). Issue: androidx/media#1237 #cherrypick PiperOrigin-RevId: 645008049
This commit is contained in:
parent
307655f6d5
commit
99803066ea
1 changed files with 2 additions and 2 deletions
|
|
@ -1783,8 +1783,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
|||
@Override
|
||||
protected void dispatchDraw(Canvas canvas) {
|
||||
super.dispatchDraw(canvas);
|
||||
if (Util.SDK_INT == 34) {
|
||||
checkNotNull(surfaceSyncGroupV34).maybeMarkSyncReadyAndClear();
|
||||
if (Util.SDK_INT == 34 && surfaceSyncGroupV34 != null) {
|
||||
surfaceSyncGroupV34.maybeMarkSyncReadyAndClear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue