[banshee] [ThickClient] Fix SourceSwitcher crasher (bgo#618117)



commit d8466ab9398a06ac325f850a5c9cef5b80150dcf
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Wed Jun 2 11:55:24 2010 -0700

    [ThickClient] Fix SourceSwitcher crasher (bgo#618117)

 .../Banshee.Sources.Gui/SourceSwitcherEntry.cs     |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceSwitcherEntry.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceSwitcherEntry.cs
index 30b1003..2376d3d 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceSwitcherEntry.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceSwitcherEntry.cs
@@ -142,7 +142,7 @@ namespace Banshee.Sources.Gui
         {
             int priority = 0;
             var name = StringUtil.SearchKey (s.Name);
-            if (name != null) {
+            if (name != null && !String.IsNullOrEmpty (query)) {
                 if (name == query) {
                     //Console.WriteLine ("{0} equals {1}", s.Name, query);
                     priority = 10;
@@ -150,7 +150,7 @@ namespace Banshee.Sources.Gui
                     //Console.WriteLine ("{0} starts with {1}", s.Name, query);
                     priority = 20;
                 } else {
-                    var split_name = name.Split (' ');
+                    var split_name = name.Split (new char [] {' '}, StringSplitOptions.RemoveEmptyEntries);
                     if (split_name.Length == query.Length &&
                         Enumerable.Range (0, query.Length).All (i => split_name[i][0] == query[i])) {
                         //Console.WriteLine ("{0} initials are {1}", s.Name, query);



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