Skip to content

Commit

Permalink
iOS app crashes - hexToDec / hex.toLowerCase - HEX data issue? #32
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed May 1, 2019
1 parent 7e811b4 commit a92055d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nfc.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ class NFCNDEFReaderSessionDelegateImpl extends NSObject implements NFCNDEFReader
}

private hexToDec(hex) {
if (hex === undefined) {
return undefined;
}

let result = 0, digitValue;
hex = hex.toLowerCase();
for (let i = 0; i < hex.length; i++) {
Expand Down Expand Up @@ -254,4 +258,4 @@ class NFCNDEFReaderSessionDelegateImpl extends NSObject implements NFCNDEFReader
}
return JSON.stringify(resultArray);
}
}
}

0 comments on commit a92055d

Please sign in to comment.