[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [ernie/master] Fix another bug.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Sun, 7 Mar 2010 21:11:33 +0100
Subject: Fix another bug.
Commit: 523a71f889979770bdbe6b5b670b71f79437fd1f

---
 src/RelayDescriptorParser.java |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/RelayDescriptorParser.java b/src/RelayDescriptorParser.java
index 5be2f79..81661ef 100644
--- a/src/RelayDescriptorParser.java
+++ b/src/RelayDescriptorParser.java
@@ -85,10 +85,12 @@ public class RelayDescriptorParser {
           }
         } else if (line.equals("vote-status vote")) {
           return;
-        } else if (line.startsWith("r ") && this.bsfh != null) {
-          String hashedRelay = DigestUtils.shaHex(Base64.decodeBase64(
-              line.split(" ")[2] + "=")).toUpperCase();
-          this.bsfh.addHashedRelay(hashedRelay);
+        } else if (line.startsWith("r ")) {
+          if (this.bsfh != null) {
+            String hashedRelay = DigestUtils.shaHex(Base64.decodeBase64(
+                line.split(" ")[2] + "=")).toUpperCase();
+            this.bsfh.addHashedRelay(hashedRelay);
+          }
           rLine = line;
         } else if (line.startsWith("s ")) {
           if (line.contains(" Running")) {
-- 
1.6.5