Calling SQLiteDataReader.IsDBNull with an invalid index (such as -1 or index >= reader.FieldCount) returns true instead of throwing an exception throws an IndexOutOfRangeException e.g.).

Let's assume we have a piece of code such as:

int SafeToInt(DbDataReader reader, string colName) {
    if (reader.IsDBNull(reader.GetOrdinal(colName))
        return someDefaultValue;
    else
        return reader.GetInt32(reader.GetOrdinal(colName));
}


int myValue = SafeToInt(reader, "ColumnNameWithTypo");    the programmer made a typo with a column name..


Since GetOrdinal returns -1 if it couldn't find a column name throws an exception in this case as well) this is directly passed to IsDBNull which evaluates to true and the default value is used. It's not obvious to the developer that he accidentially mistyped the column name. This is an annoying bug in the program and potentially hard to track down. So I think an exception is more appropriate when calling IsDBNull with an invalid index.