On 11/16/2015 12:11 PM, Igor Korot wrote: > The crash occurs when the program tries to retrieve the value for > "fieldDefaultValue". > Looking at the output of "PRAGMA table_info(<my_table_name>);" I see > that the default value column is empty (i.e. the column does not have > any value) and the column type is integer and field is a PK. > I think it also may be set as "Auto-Increment". > > The crash happens because the program hit a NULL pointer. > > Any idea on what to look for?
I'm not sure I understand the nature of the problem. Yes, it is entirely possible - common even - for a column to have no declared default value; in that case, PRAGMA table_info would report NULL in the corresponding column. Further, where there is a default value, it doesn't have to be of TEXT type. You seem to assume the default value always exists and is always a string, and so it's OK to use sqliteColumnText unconditionally - either assumption may not hold, and so it's not OK. -- Igor Tandetnik