Fix NullPointerException on eventSink

This commit is contained in:
Ryan Heise 2020-04-05 02:06:56 +10:00
parent 8d15a6c65c
commit 7911f2010f
1 changed files with 3 additions and 1 deletions

View File

@ -228,7 +228,9 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener {
event.add(updatePosition = getCurrentPosition()); event.add(updatePosition = getCurrentPosition());
event.add(updateTime = System.currentTimeMillis()); event.add(updateTime = System.currentTimeMillis());
event.add(Math.max(updatePosition, bufferedPosition)); event.add(Math.max(updatePosition, bufferedPosition));
eventSink.success(event); if (eventSink != null) {
eventSink.success(event);
}
} }
private long getCurrentPosition() { private long getCurrentPosition() {