Check the handle for font package before remove it.
authorqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 4 Feb 2008 03:18:43 +0000 (03:18 +0000)
committerqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 4 Feb 2008 03:18:43 +0000 (03:18 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@4667 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c

index ff4b0c2..11d1c76 100644 (file)
@@ -618,12 +618,10 @@ GraphicsConsoleControllerDriverStop (
     //\r
     // Remove the font pack\r
     //\r
-#if 1\r
-    HiiLibRemovePackages (Private->HiiHandle);\r
-    mFirstAccessFlag = TRUE;\r
-#else    \r
-    mHii->RemovePack (mHii, Private->HiiHandle);\r
-#endif\r
+    if (Private->HiiHandle != NULL) {\r
+      HiiLibRemovePackages (Private->HiiHandle);\r
+      mFirstAccessFlag = TRUE;\r
+    }\r
 \r
     //\r
     // Free our instance data\r