From 33514af61a3a243c6b593755097140ba74be5bb9 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Mon, 5 Nov 2018 13:32:43 +0900 Subject: [PATCH] Fix logic error. Fixes #104 --- tiny_gltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index b42020e..f33f8e9 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -1703,7 +1703,7 @@ bool WriteImageData(const std::string *basepath, const std::string *filename, } else { // Write image to disc FsCallbacks *fs = reinterpret_cast(fsPtr); - if (fs != nullptr && fs->WriteWholeFile == nullptr) { + if ((fs != nullptr) && (fs->WriteWholeFile != nullptr)) { const std::string imagefilepath = JoinPath(*basepath, *filename); std::string writeError; if (!fs->WriteWholeFile(&writeError, imagefilepath, data,