=== modified file 'src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs'
--- src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs	2008-10-08 17:15:57 +0000
+++ src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/LargeTrackInfoDisplay.cs	2009-03-21 04:49:03 +0000
@@ -32,6 +32,7 @@
 using Gtk;
 using Cairo;
 
+using Hyena;
 using Hyena.Gui;
 using Banshee.Collection;
 using Banshee.Collection.Gui;
@@ -192,7 +193,11 @@
             string line = GetSecondLineText (track);
             string second_line = line, third_line = line;
             int split_pos = line.LastIndexOf ("<span");
-            if (split_pos >= 0) {
+            if (split_pos >= 0
+                // Check that there are at least 3 spans in the string, else this
+                // will break for tracks with missing artist or album info.
+                && StringUtil.SubstringCount (line, "<span") >= 3) {
+                
                 second_line = line.Substring (0, Math.Max (0, split_pos - 1)) + "</span>";
                 third_line = String.Format ("<span color=\"{0}\">{1}",
                     CairoExtensions.ColorGetHex (TextColor, false),

=== modified file 'src/Libraries/Hyena/Hyena/StringUtil.cs'
--- src/Libraries/Hyena/Hyena/StringUtil.cs	2009-03-21 00:41:13 +0000
+++ src/Libraries/Hyena/Hyena/StringUtil.cs	2009-03-21 04:46:36 +0000
@@ -268,5 +268,24 @@
             string trimmed = input == null ? null : input.Trim ();
             return String.IsNullOrEmpty (trimmed) ? fallback : trimmed;
         }
+        
+        public static uint SubstringCount (string haystack, string needle)
+        {
+            if (String.IsNullOrEmpty (haystack) || String.IsNullOrEmpty (needle)) {
+                return 0;
+            }
+            
+            int position = 0;
+            uint count = 0;
+            while (true) {
+                int index = haystack.IndexOf (needle, position);
+                if (index < 0) {
+                    return count;
+                }
+                count++;
+                position = index + 1;
+            }
+            return count;
+        }
     }
 }

=== modified file 'src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs'
--- src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs	2009-03-21 00:41:13 +0000
+++ src/Libraries/Hyena/Hyena/Tests/StringUtilTests.cs	2009-03-21 04:39:01 +0000
@@ -321,6 +321,37 @@
             AssertSortKey ("\u0104", new byte[] {14, 2, 1, 27, 1, 1, 1, 0,});
         }
     }
+    
+    [TestFixture]
+    public class SubstringCountTests
+    {
+        private void AssertCount (string haystack, string needle, uint expected)
+        {
+            Assert.AreEqual (expected, StringUtil.SubstringCount (haystack, needle));
+        }
+        
+        [Test]
+        public void TestEmpty ()
+        {
+            AssertCount ("", "a", 0);
+            AssertCount ("a", "", 0);
+        }
+        
+        [Test]
+        public void TestNoMatches ()
+        {
+            AssertCount ("a", "b", 0);
+            AssertCount ("with needle in", "long needle", 0);
+        }
+        
+        [Test]
+        public void TestMatches ()
+        {
+            AssertCount ("abbcbba", "a", 2);
+            AssertCount ("abbcbba", "b", 4);
+            AssertCount ("with needle in", "needle", 1);
+        }
+    }
 }
 
 #endif

