From f4f5c3cf3af52fe97134c06cf4e7c0ed024456bf Mon Sep 17 00:00:00 2001 From: Marcin Kacprzak Date: Fri, 2 Sep 2022 16:15:54 +0200 Subject: [PATCH] Fix read from moved object. --- tiny_gltf.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 9fd1ee7..9b5fbc2 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -3229,9 +3229,11 @@ static bool ParseJsonAsValue(Value *ret, const json &o) { break; } #endif + const bool isNotNull = val.Type() != NULL_TYPE; + if (ret) *ret = std::move(val); - return val.Type() != NULL_TYPE; + return isNotNull; } static bool ParseExtrasProperty(Value *ret, const json &o) {