mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 00:32:37 +01:00 
			
		
		
		
	Fix clang-tidy warning "Called C++ object pointer is null"
This commit is contained in:
		| @@ -418,7 +418,13 @@ class MsgPackDeserializer { | |||||||
|  |  | ||||||
|     bool allowArray = filter.allowArray(); |     bool allowArray = filter.allowArray(); | ||||||
|  |  | ||||||
|     CollectionData* array = allowArray ? &variant->toArray() : 0; |     CollectionData* array; | ||||||
|  |     if (allowArray) { | ||||||
|  |       ARDUINOJSON_ASSERT(variant != 0); | ||||||
|  |       array = &variant->toArray(); | ||||||
|  |     } else { | ||||||
|  |       array = 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     TFilter memberFilter = filter[0U]; |     TFilter memberFilter = filter[0U]; | ||||||
|  |  | ||||||
| @@ -426,6 +432,7 @@ class MsgPackDeserializer { | |||||||
|       VariantData* value; |       VariantData* value; | ||||||
|  |  | ||||||
|       if (memberFilter.allow()) { |       if (memberFilter.allow()) { | ||||||
|  |         ARDUINOJSON_ASSERT(array != 0); | ||||||
|         value = array->addElement(_pool); |         value = array->addElement(_pool); | ||||||
|         if (!value) |         if (!value) | ||||||
|           return DeserializationError::NoMemory; |           return DeserializationError::NoMemory; | ||||||
| @@ -463,7 +470,13 @@ class MsgPackDeserializer { | |||||||
|     if (nestingLimit.reached()) |     if (nestingLimit.reached()) | ||||||
|       return DeserializationError::TooDeep; |       return DeserializationError::TooDeep; | ||||||
|  |  | ||||||
|     CollectionData* object = filter.allowObject() ? &variant->toObject() : 0; |     CollectionData* object; | ||||||
|  |     if (filter.allowObject()) { | ||||||
|  |       ARDUINOJSON_ASSERT(variant != 0); | ||||||
|  |       object = &variant->toObject(); | ||||||
|  |     } else { | ||||||
|  |       object = 0; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     for (; n; --n) { |     for (; n; --n) { | ||||||
|       err = readKey(); |       err = readKey(); | ||||||
| @@ -475,7 +488,7 @@ class MsgPackDeserializer { | |||||||
|       VariantData* member; |       VariantData* member; | ||||||
|  |  | ||||||
|       if (memberFilter.allow()) { |       if (memberFilter.allow()) { | ||||||
|         ARDUINOJSON_ASSERT(object); |         ARDUINOJSON_ASSERT(object != 0); | ||||||
|  |  | ||||||
|         // 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. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user