]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
Minor bug fix and robustness check improvement.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / SectionExtraction / CoreSectionExtraction.c
index d9fa20daa853aea3401a69920da77b6d1a2bafb8..7d4284057c0690e76013bd91b848b166760961d7 100644 (file)
@@ -807,6 +807,7 @@ FindChildNode (
   CurrentChildNode = CHILD_SECTION_NODE_FROM_LINK (GetFirstNode(&SourceStream->Children));\r
 \r
   for (;;) {\r
+    ASSERT (CurrentChildNode != NULL);\r
     if (ChildIsType (SourceStream, CurrentChildNode, SearchType, SectionDefinitionGuid)) {\r
       //\r
       // The type matches, so check the instance count to see if it's the one we want\r
@@ -877,7 +878,6 @@ FindChildNode (
         if (EFI_ERROR (Status)) {\r
           return Status;\r
         }\r
-        ASSERT (CurrentChildNode != NULL);\r
       } else {\r
         ASSERT (EFI_ERROR (ErrorStatus));\r
         return ErrorStatus;\r