ShellPkg: Do NULL pointer check before the pointer is used.
ShellPkg: Do NULL pointer check before the pointer is used.

Do NULL pointer check before the pointer is used to avoid dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <a85ffd5e6451a83645d9ceae55f1cb6cdf90c130@intel.com>
Reviewed-by: Jaben Carsey <2d4ee76b36e91bee3a58378b7538904eb027a616@intel.com>

MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2