diff --git a/src/setup_payload/tests/TestHelpers.h b/src/setup_payload/tests/TestHelpers.h index 8d84791e8b103a..dedd9040ae205e 100644 --- a/src/setup_payload/tests/TestHelpers.h +++ b/src/setup_payload/tests/TestHelpers.h @@ -141,7 +141,12 @@ inline bool CheckWriteRead(SetupPayload & inPayload, bool allowInvalidPayload = memset(optionalInfo, 0xFF, sizeof(optionalInfo)); auto generator = QRCodeSetupPayloadGenerator(inPayload); generator.SetAllowInvalidPayload(allowInvalidPayload); - generator.payloadBase38Representation(result, optionalInfo, sizeof(optionalInfo)); + CHIP_ERROR err = generator.payloadBase38Representation(result, optionalInfo, sizeof(optionalInfo)); + + if (err != CHIP_NO_ERROR) + { + return false; + } outPayload = {}; QRCodeSetupPayloadParser(result).populatePayload(outPayload);