[tor-commits] [onionoo/master] Don't include 0-character country codes in details.
karsten at torproject.org
karsten at torproject.org
Mon May 9 15:40:06 UTC 2016
commit d9c137c426487716213e6d67936fae485056a24e
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Mon May 9 17:36:10 2016 +0200
Don't include 0-character country codes in details.
Fixes #18989.
---
src/main/java/org/torproject/onionoo/updater/LookupService.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/torproject/onionoo/updater/LookupService.java b/src/main/java/org/torproject/onionoo/updater/LookupService.java
index aaa4c1c..6da3608 100644
--- a/src/main/java/org/torproject/onionoo/updater/LookupService.java
+++ b/src/main/java/org/torproject/onionoo/updater/LookupService.java
@@ -296,7 +296,9 @@ public class LookupService {
if (blockLocations.containsKey(blockNumber)) {
String[] parts = blockLocations.get(blockNumber).
replaceAll("\"", "").split(",", -1);
- lookupResult.setCountryCode(parts[4].toLowerCase());
+ if (parts[4].length() > 0) {
+ lookupResult.setCountryCode(parts[4].toLowerCase());
+ }
if (parts[5].length() > 0) {
lookupResult.setCountryName(parts[5]);
}
More information about the tor-commits
mailing list