Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [1.18][PATCH] hob/hoblistmodel: check if vals of packages/recipes names are not None
@ 2014-01-08 17:35 Paul Eggleton
  0 siblings, 0 replies; only message in thread
From: Paul Eggleton @ 2014-01-08 17:35 UTC (permalink / raw)
  To: bitbake-devel

From: Cristiana Voicu <cristiana.voicu@intel.com>

[YOCTO #5053]

(Corresponds to BitBake master rev: ba9fe77e37be31e8246431578902e871dd94515e)

Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 lib/bb/ui/crumbs/hoblistmodel.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/crumbs/hoblistmodel.py b/lib/bb/ui/crumbs/hoblistmodel.py
index 547c1ca..f6b3f09 100644
--- a/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/lib/bb/ui/crumbs/hoblistmodel.py
@@ -181,7 +181,9 @@ class PackageListModel(gtk.ListStore):
     def sort_func(self, model, iter1, iter2, user_data):
         val1 = model.get_value(iter1, PackageListModel.COL_NAME)
         val2 = model.get_value(iter2, PackageListModel.COL_NAME)
-        if val1.startswith(user_data) and not val2.startswith(user_data):
+        if val1 is None or val2 is None:
+            return 0
+        elif val1.startswith(user_data) and not val2.startswith(user_data):
             return -1
         elif not val1.startswith(user_data) and val2.startswith(user_data):
             return 1
@@ -562,7 +564,9 @@ class RecipeListModel(gtk.ListStore):
     def sort_func(self, model, iter1, iter2, user_data):
         val1 = model.get_value(iter1, RecipeListModel.COL_NAME)
         val2 = model.get_value(iter2, RecipeListModel.COL_NAME)
-        if val1.startswith(user_data) and not val2.startswith(user_data):
+        if val1 is None or val2 is None:
+            return 0
+        elif val1.startswith(user_data) and not val2.startswith(user_data):
             return -1
         elif not val1.startswith(user_data) and val2.startswith(user_data):
             return 1
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-08 17:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 17:35 [1.18][PATCH] hob/hoblistmodel: check if vals of packages/recipes names are not None Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox