Prechádzať zdrojové kódy

Fix : -[__NSArrayM allKeys]: unrecognized selector sent to instance NSDictionary

Marino Faggiana 7 rokov pred
rodič
commit
305e026a3a

+ 1 - 1
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -1731,7 +1731,7 @@
         NSDictionary *jsongParsed = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error];
         NSLog(@"[LOG] Activity : %@",jsongParsed);
         
-        if (jsongParsed && jsongParsed.allKeys > 0) {
+        if (jsongParsed && [jsongParsed isKindOfClass:[NSDictionary class]] && jsongParsed.allKeys > 0) {
             
             NSDictionary *ocs = [jsongParsed valueForKey:@"ocs"];
             NSDictionary *meta = [ocs valueForKey:@"meta"];