diff --git a/platform-darwin/Source/MPAlgorithmV0.m b/platform-darwin/Source/MPAlgorithmV0.m index e9279f11..d3747ee3 100644 --- a/platform-darwin/Source/MPAlgorithmV0.m +++ b/platform-darwin/Source/MPAlgorithmV0.m @@ -146,10 +146,10 @@ static NSOperationQueue *_mpwQueue = nil; - (NSString *)nameOfType:(MPResultType)type { - if (!type) - return nil; - switch (type) { + case MPResultTypeNone: + return @"None"; + case MPResultTypeTemplateMaximum: return @"Maximum Security Password"; @@ -189,10 +189,10 @@ static NSOperationQueue *_mpwQueue = nil; - (NSString *)shortNameOfType:(MPResultType)type { - if (!type) - return nil; - switch (type) { + case MPResultTypeNone: + return @"None"; + case MPResultTypeTemplateMaximum: return @"Maximum"; @@ -237,9 +237,6 @@ static NSOperationQueue *_mpwQueue = nil; - (Class)classOfType:(MPResultType)type { - if (!type) - Throw( @"No type given." ); - switch (type) { case MPResultTypeTemplateMaximum: return [MPGeneratedSiteEntity class]; @@ -271,6 +268,7 @@ static NSOperationQueue *_mpwQueue = nil; case MPResultTypeStatefulDevice: return [MPStoredSiteEntity class]; + case MPResultTypeNone: case MPResultTypeDeriveKey: break; } @@ -322,6 +320,7 @@ static NSOperationQueue *_mpwQueue = nil; return MPResultTypeStatefulDevice; case MPResultTypeStatefulDevice: return MPResultTypeTemplatePhrase; + case MPResultTypeNone: case MPResultTypeDeriveKey: break; } @@ -531,8 +530,13 @@ static NSOperationQueue *_mpwQueue = nil; return; } - case MPResultTypeDeriveKey: + case MPResultTypeNone: + case MPResultTypeDeriveKey: { + PearlNotMainQueue( ^{ + resultBlock( nil ); + } ); return; + } } Throw( @"Type not supported: %lu", (long)type );