Add the missing check for NULL pointer before use it.
drwxr-xr-x - edk2