MugunthKumar / MKStoreKit

The "Goto" In App Purchases Framework for iOS 8+
2.09k stars 430 forks source link

Crash is posible when status != 0 in verifyReceipt response #251

Open jglezmaestro opened 8 years ago

jglezmaestro commented 8 years ago

The actual code asumes that status != 0 only when error != nil in response. This is not true and if the status != 0 json response have no more fields, so in this lines is posible to set nil object to the dictionary.

      NSString *originalAppVersion = jsonResponse[@"receipt"][@"original_application_version"];
     ---->  (originalAppVersion might be nil) ---> [self.purchaseRecord setObject:originalAppVersion forKey:kOriginalAppVersionKey];
      [self savePurchaseRecord];