koush/sqlite-net — pull request #6 by macu (2014-01-21 22:46:53+00:00)
Title: Use default value of T in ExecuteScalar when column type is Null

When executing a SUM query the ExecuteScalar method throws NullReferenceException if the table is empty or no rows were selected by the WHERE clause or similar. In these cases SQLite3.ColumnType returns ColType.Null, ReadCol returns null, and the attempted cast to T throws the exception.

This fixes #171.