Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed issue #171 - Add new UUIDs to entries or groups if they are mis…

…sing them
  • Loading branch information...
commit 34cf56ebc29675fa9442373d255d1847f03ab477 1 parent 4b69df7
@jarush jarush authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 KeePassLib/Kdb4Parser.m
View
12 KeePassLib/Kdb4Parser.m
@@ -204,6 +204,10 @@ - (Kdb4Group *)parseGroup:(DDXMLElement *)root {
Kdb4Group *group = [[[Kdb4Group alloc] init] autorelease];
group.uuid = [self parseUuidString:[[root elementForName:@"UUID"] stringValue]];
+ if (group.uuid == nil) {
+ group.uuid = [UUID uuid];
+ }
+
group.name = [[root elementForName:@"Name"] stringValue];
group.notes = [[root elementForName:@"Notes"] stringValue];
group.image = [[[root elementForName:@"IconID"] stringValue] integerValue];
@@ -244,6 +248,10 @@ - (Kdb4Entry *)parseEntry:(DDXMLElement *)root {
Kdb4Entry *entry = [[[Kdb4Entry alloc] init] autorelease];
entry.uuid = [self parseUuidString:[[root elementForName:@"UUID"] stringValue]];
+ if (entry.uuid == nil) {
+ entry.uuid = [UUID uuid];
+ }
+
entry.image = [[[root elementForName:@"IconID"] stringValue] integerValue];
DDXMLElement *customIconUuidElement = [root elementForName:@"CustomIconUUID"];
@@ -344,6 +352,10 @@ - (AutoType *)parseAutoType:(DDXMLElement *)root {
}
- (UUID *)parseUuidString:(NSString *)uuidString {
+ if ([uuidString length] == 0) {
+ return nil;
+ }
+
NSData *data = [Base64 decode:[uuidString dataUsingEncoding:NSUTF8StringEncoding]];
return [[[UUID alloc] initWithData:data] autorelease];
}
Please sign in to comment.
Something went wrong with that request. Please try again.