mirror of
https://github.com/samsonjs/media.git
synced 2026-04-06 11:25:46 +00:00
Fix a potential NPE in test_utils WebServerDispatcher
PiperOrigin-RevId: 429338648
This commit is contained in:
parent
a2337adbb8
commit
a55219fbf1
1 changed files with 2 additions and 1 deletions
|
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue