Commit a55219fb by olly Committed by Ian Baker

Fix a potential NPE in test_utils WebServerDispatcher

PiperOrigin-RevId: 429338648
parent a2337adb
......@@ -28,6 +28,7 @@ import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.util.Util;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
......@@ -239,7 +240,7 @@ public class WebServerDispatcher extends Dispatcher {
/** Returns the path for a given {@link RecordedRequest}, stripping any query parameters. */
public static String getRequestPath(RecordedRequest request) {
return Util.splitAtFirst(request.getPath(), "\\?")[0];
return Util.splitAtFirst(Strings.nullToEmpty(request.getPath()), "\\?")[0];
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment