diff options
author | bamse16 <marius@marius.me.uk> | 2009-03-23 19:31:11 +0000 |
---|---|---|
committer | bamse16 <marius@marius.me.uk> | 2009-03-23 19:31:11 +0000 |
commit | d09e3a2a855c80a5a69017a53a7d62e5324f0c26 (patch) | |
tree | b840061064c71b1c1471114c5b3f782609821ae4 | |
parent | 7a43632673b88630644c8b352f584267d3a7fffc (diff) | |
download | sequelpro-d09e3a2a855c80a5a69017a53a7d62e5324f0c26.tar.gz sequelpro-d09e3a2a855c80a5a69017a53a7d62e5324f0c26.tar.bz2 sequelpro-d09e3a2a855c80a5a69017a53a7d62e5324f0c26.zip |
Issue 201: Duplicating a row resets values of text/blob fields in the new row
Changes after code review: renamed variable, replaced @"NULL" with [prefs objectForKey:@"nullValue"]
-rw-r--r-- | Source/TableContent.m | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index bec112ff..69c1641a 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -694,13 +694,13 @@ if ( [[row objectForKey:@"Extra"] isEqualToString:@"auto_increment"] ) { [tempRow setObject:[prefs stringForKey:@"nullValue"] forKey:[row objectForKey:@"Field"]]; } else if ( [tableDataInstance columnIsBlobOrText:[row objectForKey:@"Field"]] && [prefs boolForKey:@"dontShowBlob"] && dbDataRow) { - NSString *nullValue = nil; + NSString *valueString = nil; //if what we read from DB is NULL (NSNull), we replace it with the string NULL if([[dbDataRow objectForKey:[row objectForKey:@"Field"]] isKindOfClass:[NSNull class]]) - nullValue = @"NULL"; + valueString = [prefs objectForKey:@"nullValue"]; else - nullValue = [dbDataRow objectForKey:[row objectForKey:@"Field"]]; - [tempRow setObject:nullValue forKey:[row objectForKey:@"Field"]]; + valueString = [dbDataRow objectForKey:[row objectForKey:@"Field"]]; + [tempRow setObject:valueString forKey:[row objectForKey:@"Field"]]; } } |