Преглед изворни кода

Fix possible nullptr dereferences.

Kim Kulling пре 4 година
родитељ
комит
88ccfedd10
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      include/assimp/XmlParser.h

+ 6 - 0
include/assimp/XmlParser.h

@@ -183,12 +183,18 @@ public:
     /// @brief  Will return the root node, const version.
     /// @return The root node.
     const TNodeType getRootNode() const {
+        if (nullptr == mDoc) {
+            return nullptr;
+        }
         return mDoc->root();
     }
 
     /// @brief  Will return the root node, non-const version.
     /// @return The root node.
     TNodeType getRootNode() {
+        if (nullptr == mDoc) {
+            return nullptr;
+        }
         return mDoc->root();
     }