[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionoo/master] Fix details documents without descriptor parts.
commit 3c646f0ac60de7290b140e36a24efb97a1636479
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Sat Jan 5 21:40:42 2013 +0100
Fix details documents without descriptor parts.
99.9% of details documents contain parts from the relay's or bridge's
server descriptor. But 0.01% of these server descriptors cannot be found.
Handle these missing descriptor parts correctly, and don't produce invalid
JSON.
Bug found by gsathya.
---
src/org/torproject/onionoo/DetailDataWriter.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/org/torproject/onionoo/DetailDataWriter.java b/src/org/torproject/onionoo/DetailDataWriter.java
index d681958..dcea869 100644
--- a/src/org/torproject/onionoo/DetailDataWriter.java
+++ b/src/org/torproject/onionoo/DetailDataWriter.java
@@ -860,7 +860,7 @@ public class DetailDataWriter {
}
/* Append descriptor and bridge pool assignment parts. */
- if (descriptorParts != null) {
+ if (descriptorParts != null && descriptorParts.length() != 0) {
sb.append(",\n" + descriptorParts);
}
if (bridgePoolAssignment != null) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits