2013-03-24 23:53:49.754 Catapult for iOS[65266:c07] -[NSNull length]: unrecognized selector sent to instance 0x14f2678
2013-03-24 23:53:49.754 Catapult for iOS[65266:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x14f2678'
*** First throw call stack:
(0x13c1012 0x11e6e7e 0x144c4bd 0x13b0bbc 0x13b094e 0xf074 0x185e3 0x13b51bd 0x13b50d6 0x1531a 0x1512b 0x14ae2 0x13b51bd 0x13b50d6 0x11d0a 0x1032a 0x13b51bd 0x13b50d6 0x79be 0x77ed 0x8cf2 0xcec589 0xcea652 0xceb89a 0xcea60d 0xcea785 0xc37a68 0x4a2a911 0x4a29bb3 0x4a67cda 0x13638fd 0x4a6835c 0x4a682d5 0x4952250 0x1344f3f 0x1344a39 0x1367734 0x1366f44 0x1366e1b 0x22be7e3 0x22be668 0x12affc 0x2c5d 0x2b85)
libc++abi.dylib: terminate called throwing an exception
I do not understand that error message and I do not know how to debug it at all...
Does anyone know what the problem might be please?
BOOL canAuth = [token length] > 0;
https://catapultcentral.com/iOSClientCallback?code=07b6ba09e3279afb878ee9532ef36c60f2888ba23bd412dcce47a75183dfa75d which seems fine to me... so I do not understand what the problem is...
- (BOOL)canAuthorize {
NSString *token = self.refreshToken;
if (token == nil) {
// For services which do not support refresh tokens, we'll just check
// the access token.
token = self.authorizationToken;
}
BOOL canAuth = [token length] > 0;
return canAuth;
}
If self.refreshToken is nil, token will get self.authorizationToken which in place is [NSNull null] even though the server is returning an authorization token as a GET param when redirecting to the redirect URI. The GET param nam is "code", is that the problem?
if (token == nil) {
I modified it:
if ([token isKindOfClass:[NSNull class]]) {
-------------------------------------------------------------------
GTMOAuth2Authentication.m line 1167 was:
if (str) {
I modified it:
if (![str isKindOfClass:[NSNull class]]) {
-------------------------------------------------------------------
Those changes fixed my problem. I wonder if they could be integrated into the library. What do you think?
[GTMHTTPFetcher setLoggingEnabled:YES];
[GTMHTTPFetcher setLoggingDirectory:@"/Users/aziz/Desktop/"];
in the main view controller but that didn't do anything. I also imported the logging library (obviously)....
What I want to know is why the app crashes when I disable refresh tokens on the server? If I enable them all works fine, but the Ruby on Rails gem (library) that I use disables refresh tokens for a reason.
--
You received this message because you are subscribed to the Google Groups "GTM OAuth 2 Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtm-oauth2+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Good question. I don't know the answer, but that's what I get and the only fix that I found was to change the library the way I changed it. A good compromise would be this condition:if (token == nil || [token isKindOfClass:[NSNull class]]) { ...That's the only thing I can think of. I would love to find a solution where I don't have to change the gtm-oauth2 library but that didn't happen yet....