diff --git a/YTKKeyValueStore/YTKKeyValueStore.m b/YTKKeyValueStore/YTKKeyValueStore.m index c00c67e..23ccf5b 100644 --- a/YTKKeyValueStore/YTKKeyValueStore.m +++ b/YTKKeyValueStore/YTKKeyValueStore.m @@ -148,6 +148,10 @@ - (void)putObject:(id)object withId:(NSString *)objectId intoTable:(NSString *)t if ([YTKKeyValueStore checkTableName:tableName] == NO) { return; } + if (!object) { + debugLog(@"ERROR, faild to get json data, object can't be nil"); + return; + } NSError * error; NSData * data = [NSJSONSerialization dataWithJSONObject:object options:0 error:&error]; if (error) {