Skip to content

Commit

Permalink
Fix: /rest/system/error list can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
kozec committed Oct 21, 2015
1 parent 8e1b836 commit ea959e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions syncthing_gtk/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,11 +751,12 @@ def _syncthing_cb_events(self, events):
self.timer("event", self._refresh_interval, self._request_events)

def _syncthing_cb_errors(self, errors):
for e in errors["errors"]:
t = parsetime(e["time"])
if t > self._last_error_time:
self.emit("error", e["error"])
self._last_error_time = t
if errors["errors"] is not None:
for e in errors["errors"]:
t = parsetime(e["time"])
if t > self._last_error_time:
self.emit("error", e["error"])
self._last_error_time = t
self.timer("errors", self._refresh_interval * 5, self._rest_request, "system/error", self._syncthing_cb_errors)

def _syncthing_cb_events_error(self, exception, command):
Expand Down

0 comments on commit ea959e6

Please sign in to comment.