From f27607e63c3e4bc2fddafae3e2d73ae603bbc990 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 1 Nov 2021 20:52:04 -0400 Subject: [PATCH] fixup! Support for unset login type. --- platform-darwin/Source/MPAlgorithmV0.m | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) 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 );