Fix deleting of users.
[FIXED] When retrieving content without a key set, return nil.
This commit is contained in:
2
External/Pearl
vendored
2
External/Pearl
vendored
Submodule External/Pearl updated: 2a158bc768...396fe5bd8a
@@ -7,7 +7,7 @@
|
|||||||
buildImplicitDependencies = "YES">
|
buildImplicitDependencies = "YES">
|
||||||
<BuildActionEntries>
|
<BuildActionEntries>
|
||||||
<BuildActionEntry
|
<BuildActionEntry
|
||||||
buildForTesting = "NO"
|
buildForTesting = "YES"
|
||||||
buildForRunning = "YES"
|
buildForRunning = "YES"
|
||||||
buildForProfiling = "YES"
|
buildForProfiling = "YES"
|
||||||
buildForArchiving = "YES"
|
buildForArchiving = "YES"
|
||||||
|
@@ -104,6 +104,10 @@
|
|||||||
|
|
||||||
- (id)content {
|
- (id)content {
|
||||||
|
|
||||||
|
NSData *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return nil;
|
||||||
|
|
||||||
if (!(self.type & MPElementTypeClassGenerated)) {
|
if (!(self.type & MPElementTypeClassGenerated)) {
|
||||||
err(@"Corrupt element: %@, type: %d is not in MPElementTypeClassGenerated", self.name, self.type);
|
err(@"Corrupt element: %@, type: %d is not in MPElementTypeClassGenerated", self.name, self.type);
|
||||||
return nil;
|
return nil;
|
||||||
@@ -112,7 +116,7 @@
|
|||||||
if (![self.name length])
|
if (![self.name length])
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return MPCalculateContent(self.type, self.name, [MPAppDelegate get].key, self.counter);
|
return MPCalculateContent(self.type, self.name, key, self.counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -131,12 +135,20 @@
|
|||||||
|
|
||||||
- (id)content {
|
- (id)content {
|
||||||
|
|
||||||
return [self contentUsingKey:[MPAppDelegate get].key];
|
NSData *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
return [self contentUsingKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setContent:(id)content {
|
- (void)setContent:(id)content {
|
||||||
|
|
||||||
[self setContent:content usingKey:[MPAppDelegate get].key];
|
NSData *key = [MPAppDelegate get].key;
|
||||||
|
if (!key)
|
||||||
|
return;
|
||||||
|
|
||||||
|
[self setContent:content usingKey:key];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)contentUsingKey:(NSData *)key {
|
- (id)contentUsingKey:(NSData *)key {
|
||||||
|
Reference in New Issue
Block a user