Merge branch 'null-uri-path' into 'master'
Avoid NPE in Uri.getPath().replaceAll() Fixes #533. See merge request !199
This commit is contained in:
commit
02c8fac906
@ -583,10 +583,13 @@ public class ManageReposActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uri = uri.normalize();
|
uri = uri.normalize();
|
||||||
String path = uri.getPath().replaceAll("//*/", "/"); // Collapse multiple forward slashes into 1.
|
String path = uri.getPath();
|
||||||
|
if (path != null) {
|
||||||
|
path = path.replaceAll("//*/", "/"); // Collapse multiple forward slashes into 1.
|
||||||
if (path.length() > 0 && path.charAt(path.length() - 1) == '/') {
|
if (path.length() > 0 && path.charAt(path.length() - 1) == '/') {
|
||||||
path = path.substring(0, path.length() - 1);
|
path = path.substring(0, path.length() - 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(),
|
return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(),
|
||||||
path, uri.getQuery(), uri.getFragment()).toString();
|
path, uri.getQuery(), uri.getFragment()).toString();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user