Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 89f659a

Browse files
Fixed a crash when the eventSink is called on a null object in the video_player.
1 parent f1c519c commit 89f659a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/video_player/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ public void onBufferingUpdate(MediaPlayer mediaPlayer, int percent) {
114114
new MediaPlayer.OnErrorListener() {
115115
@Override
116116
public boolean onError(MediaPlayer mp, int what, int extra) {
117-
eventSink.error(
118-
"VideoError", "Video player had error " + what + " extra " + extra, null);
117+
if (eventSink != null) {
118+
eventSink.error(
119+
"VideoError", "Video player had error " + what + " extra " + extra, null);
120+
}
119121
return true;
120122
}
121123
});

0 commit comments

Comments
 (0)