diff --git a/TPInAppReceipt.podspec b/TPInAppReceipt.podspec
index ca9ac59..4cc86f2 100644
--- a/TPInAppReceipt.podspec
+++ b/TPInAppReceipt.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "TPInAppReceipt"
-s.version = "2.1.2"
+s.version = "2.1.3"
s.summary = "Decode Apple Store Receipt and make it easy to read and validate it"
s.description = "The library provides transparent way to decode and validate Apple Store Receipt. Pure swift, No OpenSSL!"
diff --git a/TPInAppReceipt/Info.plist b/TPInAppReceipt/Info.plist
index a8e75cc..0cf0ba4 100644
--- a/TPInAppReceipt/Info.plist
+++ b/TPInAppReceipt/Info.plist
@@ -15,7 +15,7 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 2.1.1
+ 2.1.3
CFBundleVersion
$(CURRENT_PROJECT_VERSION)
NSPrincipalClass
diff --git a/TPInAppReceipt/Source/ASN1Object+ValueReading.swift b/TPInAppReceipt/Source/ASN1Object+ValueReading.swift
index 7e50bc9..49bd9ac 100644
--- a/TPInAppReceipt/Source/ASN1Object+ValueReading.swift
+++ b/TPInAppReceipt/Source/ASN1Object+ValueReading.swift
@@ -129,21 +129,16 @@ extension ASN1Object
return nil
}
- guard ASN1Object.isDataValid(&valueData) else
- {
- return valueData
- }
-
switch type
{
case .integer:
return ASN1.readInt(from: &valueData, l: l)
case .octetString:
- return ASN1Object(data: valueData)
+ return ASN1Object.isDataValid(&valueData) ? ASN1Object(data: valueData) : valueData
case .endOfContent: //Treat it as unknown type of some constructed type
if identifier.isConstructed
{
- return ASN1Object(data: valueData)
+ return ASN1Object.isDataValid(&valueData) ? ASN1Object(data: valueData) : valueData
}else{
return nil
}
@@ -176,7 +171,7 @@ extension ASN1Object
case .relativeOid:
return ASN1.readOid(contentData: &valueData)
case .sequence, .set:
- return ASN1Object(data: valueData)
+ return ASN1Object.isDataValid(&valueData) ? ASN1Object(data: valueData) : valueData
case .videotexString:
return "videotexString"
case .ia5String: