File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -507,7 +507,10 @@ - (void)dropAllTable
507
507
NSMutableArray * dropTables = [NSMutableArray arrayWithCapacity: 0 ];
508
508
509
509
while ([set next ]) {
510
- [dropTables addObject: [set stringForColumnIndex: 0 ]];
510
+ NSString * tableName = [set stringForColumnIndex: 0 ];
511
+ if (tableName) {
512
+ [dropTables addObject: tableName];
513
+ }
511
514
}
512
515
513
516
[set close ];
@@ -1062,7 +1065,10 @@ - (NSMutableArray*)executeResult:(FMResultSet*)set Class:(Class)modelClass table
1062
1065
1063
1066
while ([set next ]) {
1064
1067
NSObject * bindingModel = [[modelClass alloc ] init ];
1065
-
1068
+ if (bindingModel == nil ) {
1069
+ continue ;
1070
+ }
1071
+
1066
1072
for (int i = 0 ; i < columnCount; i++) {
1067
1073
NSString * sqlName = [set columnNameForIndex: i];
1068
1074
LKDBProperty* property = [infos objectWithSqlColumnName: sqlName];
@@ -1188,7 +1194,9 @@ - (BOOL)insertBase:(NSObject*)model
1188
1194
}
1189
1195
1190
1196
id value = [self modelValueWithProperty: property model: model];
1191
-
1197
+ if (value == nil ) {
1198
+ continue ;
1199
+ }
1192
1200
// /跳过 rowid = 0 的属性
1193
1201
if ([property.sqlColumnName isEqualToString: @" rowid" ] && ([value intValue ] == 0 )) {
1194
1202
continue ;
@@ -1279,6 +1287,9 @@ - (BOOL)updateToDBBase:(NSObject*)model where:(id)where
1279
1287
continue ;
1280
1288
}
1281
1289
id value = [self modelValueWithProperty: property model: model];
1290
+ if (value == nil ) {
1291
+ continue ;
1292
+ }
1282
1293
// /跳过 rowid = 0 的属性
1283
1294
if ([property.sqlColumnName isEqualToString: @" rowid" ]) {
1284
1295
int rowid = [value intValue ];
You can’t perform that action at this time.
0 commit comments