banshee r4030 - in trunk/banshee: . src/Libraries/Hyena/Hyena.Data.Sqlite



Author: gburt
Date: Thu May 29 22:47:04 2008
New Revision: 4030
URL: http://svn.gnome.org/viewvc/banshee?rev=4030&view=rev

Log:
2008-05-29  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs: Fix crasher
	in save-selection by being properly defensive and not assuming the item
	pointed to by the selection focus is still in the model.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs

Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/SqliteModelCache.cs	Thu May 29 22:47:04 2008
@@ -297,7 +297,10 @@
                 saved_selection = true;
                 
                 if (!has_select_all_item && model.Selection.FocusedIndex != -1) {
-                    saved_focus_entry_id = (int) GetValue (model.Selection.FocusedIndex).CacheEntryId;
+                    T item = GetValue (model.Selection.FocusedIndex);
+                    if (item != null) {
+                        saved_focus_entry_id = (int) GetValue (model.Selection.FocusedIndex).CacheEntryId;
+                    }
                 }
 
                 long start, end;



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