What steps will reproduce the problem?
1. Create a class WidgetPart that extends SQLitePersistentObject.
2. Create a class Widget that has a property of type WidgetPart.
3. Save a Widget instance with a nil value for the WidgetPart property.
4. [Widget allObjects]
What is the expected output? What do you see instead?
Expected result is an array with a Widget object containing a nil value for the
WidgetPart
property.
Actual result is a runtime exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '***
+[NSString stringWithUTF8String:]: NULL cString'
What version of the product are you using? On what operating system?
URL: http://sqlitepersistentobjects.googlecode.com/svn/trunk
Repository Root: http://sqlitepersistentobjects.googlecode.com/svn
Repository UUID: e86f48c2-4f55-0410-860d-1fbeb81bd84d
Revision: 28
Please provide any additional information below.
Workaround: do a check for null at SQLitePersistentObject.m around line 238:
if ([propClass isSubclassOfClass:[SQLitePersistentObject class]])
{
const char *keyCStr = (const char
*)sqlite3_column_text(statement, i);
if (keyCStr) {
NSString *objMemoryMapKey = [NSString
stringWithUTF8String:keyCStr];
// and so on
}
else {
[oneItem setValue:nil forKey:propName];
}
}
Original issue reported on code.google.com by paule...@gmail.com on 13 Jan 2009 at 5:34
Original issue reported on code.google.com by
paule...@gmail.com
on 13 Jan 2009 at 5:34