diff --git a/Example/Assets/Scripts/SQLite.cs b/Example/Assets/Scripts/SQLite.cs index 18ce6c3..9d6f591 100644 --- a/Example/Assets/Scripts/SQLite.cs +++ b/Example/Assets/Scripts/SQLite.cs @@ -2175,7 +2175,10 @@ public T ExecuteScalar () var r = SQLite3.Step (stmt); if (r == SQLite3.Result.Row) { var colType = SQLite3.ColumnType (stmt, 0); - val = (T)ReadCol (stmt, 0, colType, typeof(T)); + object colValue = ReadCol(stmt, 0, colType, typeof(T)); + if(colValue == null) { return default(T); } + + return (T)colValue; } else if (r == SQLite3.Result.Done) { }