diff --git a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html
index 2bccc8bfe..0a11c0bf4 100644
--- a/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html
+++ b/deluge/ui/webui/webui_plugin/templates/advanced/part_stats.html
@@ -13,6 +13,8 @@ $else:
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
$#end
+$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
+
diff --git a/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html b/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html
index 305a9ea25..314e7c2d4 100644
--- a/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html
+++ b/deluge/ui/webui/webui_plugin/templates/deluge/part_stats.html
@@ -12,6 +12,9 @@ $else:
$_('Off')
$:render.part_button('POST', '/refresh/on', _('Enable'), 'tango/view-refresh.png')
$#end
+
+$:render.part_button('POST', '/logout', _('Logout'), 'tango/system-log-out.png')
+
diff --git a/deluge/ui/webui/webui_plugin/webserver_common.py b/deluge/ui/webui/webui_plugin/webserver_common.py
index aa12ca6fb..ab332a119 100644
--- a/deluge/ui/webui/webui_plugin/webserver_common.py
+++ b/deluge/ui/webui/webui_plugin/webserver_common.py
@@ -118,12 +118,14 @@ class SyncProxyFunction:
self.client = client
def __call__(self,*args,**kwargs):
- sync_result = []
func = getattr(self.client,self.func_name)
if self.has_callback(func):
+ sync_result = []
func(sync_result.append,*args, **kwargs)
self.client.force_call(block=True)
+ if not sync_result:
+ return None
return sync_result[0]
else:
ws.log.debug('no-cb: %s' % self.func_name)