JsonVariantConst::isNull() tests if the JsonVariantConst is unbound or points to a null value.

Remember that a JsonVariant is a reference to a value in a JsonDocument. A JsonVariant that is not attached to a JsonDocument will always be null:

JsonVariantConst variant;
variant.isNull(); // returns true

As an alternative, you can use the conversion to bool; for example, if(variant) instead of if(!variant.isNull())


bool isNull() const;

Return value

See also