Fix issue on null ptr in funciton positionToString

Error message is as below:
smbiosmdrv2app[5607]: terminate called after throwing an instance of 'std::logic_error'
smbiosmdrv2app[5607]:   what():  basic_string::_M_construct null not valid
systemd[1]: smbios-mdrv2.service: Main process exited, code=dumped, status=6/ABRT
systemd[1]: smbios-mdrv2.service: Failed with result 'core-dump'.

Have to check ptr is not null before using.

Tested:
When target prt is null return empty string, not crash app.

Change-Id: I5bc4c2681150fd1a7aeb0a2dc7b5d19e5b54dab0
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
1 file changed