[tor-commits] [onionoo/master] Fix details documents without descriptor parts.

karsten at torproject.org karsten at torproject.org
Sat Jan 5 21:47:06 UTC 2013


commit 3c646f0ac60de7290b140e36a24efb97a1636479
Author: Karsten Loesing <karsten.loesing at gmx.net>
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) {



More information about the tor-commits mailing list