Added checking for null pointers when processing icon id and icon file.  Fixes issue #763