Author: abock
Date: Sat Feb 16 21:22:20 2008
New Revision: 3246
URL: http://svn.gnome.org/viewvc/banshee?rev=3246&view=rev

Log:
2008-02-16  Aaron Bockover  <[EMAIL PROTECTED]>

    * src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs: Added
    a necessary null check and return default (T) for the generic Query
    method that Scott introduced - fixes the bug everyone has been complaining
    about



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

Modified: 
trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs
==============================================================================
--- 
trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs    
    (original)
+++ 
trunk/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteConnection.cs    
    Sat Feb 16 21:22:20 2008
@@ -212,8 +212,10 @@
         
         public T Query<T> (SqliteCommand command)
         {
-            return (T) SqliteUtils.FromDbFormat (typeof (T),
-                Convert.ChangeType (ExecuteScalar (command), typeof (T)));
+            object result = ExecuteScalar (command);
+            return result == null 
+                ? default (T)
+                : (T)SqliteUtils.FromDbFormat (typeof (T), Convert.ChangeType 
(result, typeof (T)));
         }
         
         public T Query<T> (HyenaSqliteCommand command)
_______________________________________________
SVN-commits-list mailing list (read only)
http://mail.gnome.org/mailman/listinfo/svn-commits-list

Want to limit the commits to a few modules? Go to above URL, log in to edit 
your options and select the modules ('topics') you want.
Module maintainer? It is possible to set the reply-to to your development 
mailing list. Email [EMAIL PROTECTED] if interested.

Reply via email to