From 9c104aac36605be324eafd079234e754ddda67e0 Mon Sep 17 00:00:00 2001 From: Tom Yan Date: Wed, 4 Apr 2018 18:52:14 +0800 Subject: [PATCH] MediaPlayerAPI: prevent NullPointerException Fixes #154. --- app/src/main/java/com/termux/api/MediaPlayerAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/termux/api/MediaPlayerAPI.java b/app/src/main/java/com/termux/api/MediaPlayerAPI.java index 2b942e9..271c70e 100644 --- a/app/src/main/java/com/termux/api/MediaPlayerAPI.java +++ b/app/src/main/java/com/termux/api/MediaPlayerAPI.java @@ -125,7 +125,7 @@ public class MediaPlayerAPI { } protected static MediaCommandHandler getMediaCommandHandler(final String command) { - switch (command.toUpperCase()) { + switch (command == null ? "" : command.toUpperCase()) { case "INFO": return infoHandler; case "PLAY":