Skip to content

Commit

Permalink
Merge pull request #779 from maiksd/fix_npe_in_uuid_pk
Browse files Browse the repository at this point in the history
Fix critical NPE in UUID primary key generation code
  • Loading branch information
darkv authored Jun 30, 2016
2 parents 5feab46 + 12525c2 commit 377720d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ public NSDictionary<String, Object> rawPrimaryKeyDictionary(boolean inTransactio
private NSDictionary<String, Object> createUuidPrimaryKey(NSArray<EOAttribute> primaryKeyAttributes) {
if (primaryKeyAttributes.count() == 1) {
EOAttribute primaryKeyAttribute = primaryKeyAttributes.objectAtIndex(0);
if (primaryKeyAttribute.prototypeName().equals(uuidPrototypeName)) {
String prototypeName = primaryKeyAttribute.prototypeName();
if (prototypeName != null && prototypeName.equals(uuidPrototypeName)) {
return new NSDictionary<String, Object>(UUIDUtilities.generateAsNSData(), primaryKeyAttribute.name());
}
}
Expand Down

0 comments on commit 377720d

Please sign in to comment.