Added NFC_INVALID message

This commit is contained in:
Alexander Cerutti
2019-06-30 02:10:12 +02:00
parent 1226bb21c7
commit 35789a3d34
2 changed files with 4 additions and 3 deletions

View File

@@ -26,7 +26,8 @@ const debugMessages: MessageGroup = {
BRC_AUTC_MISSING_DATA: "Unable to autogenerate barcodes. Data is not a string.", BRC_AUTC_MISSING_DATA: "Unable to autogenerate barcodes. Data is not a string.",
BRC_BW_FORMAT_UNSUPPORTED: "This format is not supported (by Apple) for backward support. Please choose another one.", BRC_BW_FORMAT_UNSUPPORTED: "This format is not supported (by Apple) for backward support. Please choose another one.",
BRC_NO_POOL: "Cannot set barcode: no barcodes found. Please set barcodes first. Barcode is for retrocompatibility only.", BRC_NO_POOL: "Cannot set barcode: no barcodes found. Please set barcodes first. Barcode is for retrocompatibility only.",
DATE_FORMAT_UNMATCH: "%s was not set due to incorrect date format." DATE_FORMAT_UNMATCH: "%s was not set due to incorrect date format.",
NFC_INVALID: "Unable to set NFC properties: data not compliant with schema."
}; };
/** /**

View File

@@ -442,8 +442,8 @@ export class Pass implements PassIndexSignature {
return this; return this;
} }
if (!(typeof data === "object" && !Array.isArray(data) && schema.isValid(data, "nfcDict"))) { if (!(data && typeof data === "object" && !Array.isArray(data) && schema.isValid(data, "nfcDict"))) {
genericDebug("Invalid NFC data provided"); genericDebug(formatMessage("NFC_INVALID"));
return this; return this;
} }