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,