Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in accountsFromDefaultKeychain assert #197

Open
GabeJacobs opened this issue Nov 17, 2015 · 1 comment
Open

Crash in accountsFromDefaultKeychain assert #197

GabeJacobs opened this issue Nov 17, 2015 · 1 comment

Comments

@GabeJacobs
Copy link

I often get a crash when booting up my app at the NSAssert in this block in the NXOAuth2AccountStore class.

+ (NSDictionary *)accountsFromDefaultKeychain;
{
    NSString *serviceName = [self keychainServiceName];

    NSDictionary *result = nil;
    NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
                           (__bridge NSString *)kSecClassGenericPassword, kSecClass,
                           serviceName, kSecAttrService,
                           kCFBooleanTrue, kSecReturnAttributes,
                           nil];
    CFTypeRef cfResult = nil;
    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &cfResult);
    result = (__bridge_transfer NSDictionary *)cfResult;

    if (status != noErr) {
       NSAssert1(status == errSecItemNotFound, @"Unexpected error while fetching accounts from keychain: %ld", status);
        return nil;
    }

    return [NSKeyedUnarchiver unarchiveObjectWithData:[result objectForKey:(__bridge NSString *)kSecAttrGeneric]];
}

Here is the error:

2015-11-17 12:57:59.550 Cymbal[15805:4161141] *** Assertion failure in +[NXOAuth2AccountStore accountsFromDefaultKeychain], /Users/gabejacobs/Desktop/Anthem-iOS/Pods/NXOAuth2Client/Sources/OAuth2Client/NXOAuth2AccountStore.m:583

any clue?

@sirnacnud
Copy link
Contributor

I think this is the same issue as #188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants