Add assertions to comfort Clang-Tidy

This commit is contained in:
Benoit Blanchon
2022-01-13 18:44:57 +01:00
parent 21b2c76524
commit 3c145f1782

View File

@ -48,6 +48,11 @@ class MsgPackDeserializer {
bool allowValue = filter.allowValue(); bool allowValue = filter.allowValue();
if (allowValue) {
// callers pass a null pointer only when value must be ignored
ARDUINOJSON_ASSERT(variant != 0);
}
switch (code) { switch (code) {
case 0xc0: case 0xc0:
// already null // already null
@ -422,6 +427,8 @@ class MsgPackDeserializer {
VariantData *member; VariantData *member;
if (memberFilter.allow()) { if (memberFilter.allow()) {
ARDUINOJSON_ASSERT(object);
// Save key in memory pool. // Save key in memory pool.
// This MUST be done before adding the slot. // This MUST be done before adding the slot.
key = _stringStorage.save(); key = _stringStorage.save();