nanohttpd: fix npe introduced in 2df9dde936

This commit is contained in:
Haowei Wen 2020-08-26 15:23:03 +08:00
parent 2df9dde936
commit 86feaa3273
No known key found for this signature in database
GPG key ID: 5BC167F73EA558E4

View file

@ -222,9 +222,9 @@ public abstract class NanoHTTPD {
String rawUri = st.nextToken(); String rawUri = st.nextToken();
// Decode parameters from the URI // Decode parameters from the URI
int qmi = uri.indexOf('?'); int qmi = rawUri.indexOf('?');
if (qmi >= 0) { if (qmi >= 0) {
this.queryParameterString = uri.substring(qmi + 1); this.queryParameterString = rawUri.substring(qmi + 1);
this.parms = Collections.unmodifiableMap(decodeParms(this.queryParameterString)); this.parms = Collections.unmodifiableMap(decodeParms(this.queryParameterString));
this.uri = decodePercent(rawUri.substring(0, qmi)); this.uri = decodePercent(rawUri.substring(0, qmi));
} else { } else {