[tor-commits] [nyx/master] Exit stats dialog crashed if no data was available

atagar at torproject.org atagar at torproject.org
Sun Apr 15 20:29:19 UTC 2018


commit 1d2683e08b181e1a929748faeaab7bbab13f128b
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Apr 15 13:28:08 2018 -0700

    Exit stats dialog crashed if no data was available
    
    Showing the exit stats dialog (pressing 'e' on the connection page) stacktraced
    if no exit stats were available...
    
      https://trac.torproject.org/projects/tor/ticket/25801
---
 nyx/panel/connection.py  | 2 +-
 web/changelog/index.html | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/nyx/panel/connection.py b/nyx/panel/connection.py
index 98b0baf..ac4a234 100644
--- a/nyx/panel/connection.py
+++ b/nyx/panel/connection.py
@@ -391,7 +391,7 @@ class ConnectionPanel(nyx.panel.DaemonPanel):
 
     def _show_exiting_port_usage():
       counts = {}
-      key_width = max(map(len, self._exit_port_usage.keys()))
+      key_width = max(map(len, self._exit_port_usage.keys())) if self._exit_port_usage else 0
 
       for k, v in self._exit_port_usage.items():
         usage = connection.port_usage(k)
diff --git a/web/changelog/index.html b/web/changelog/index.html
index 196d82b..bf8e1a3 100644
--- a/web/changelog/index.html
+++ b/web/changelog/index.html
@@ -83,6 +83,7 @@
         <li><span class="component">Connections</span>
           <ul>
             <li>Geoip information unavailable for inbound connections</li>
+            <li>Dialog showing exit statistics crashed when no data was available (:trac:`25801`)</li>
           </ul>
         </li>
 



More information about the tor-commits mailing list