[kupfer] windows: Check variables in get_description



commit baad06e43ee31e3c3454aea5ab70245741b85932
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Mar 16 23:12:56 2011 +0100

    windows: Check variables in get_description
    
    (The window plugin might not have all data in early startup and
    fields can be None).

 kupfer/plugin/windows.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/windows.py b/kupfer/plugin/windows.py
index 608789e..ab3aa02 100644
--- a/kupfer/plugin/windows.py
+++ b/kupfer/plugin/windows.py
@@ -46,6 +46,8 @@ class WindowLeaf (Leaf):
 
 	def get_description(self):
 		workspace = self.object.get_workspace()
+		if not workspace:
+			return u""
 		nr, name = workspace.get_number(), workspace.get_name()
 		# TRANS: Window on (Workspace name), window description
 		return _("Window on %(wkspc)s") % {"wkspc": name}



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