fix , fetal error, a getIconUrl() on a non-object

if a $var['entity'] is not set , redirect user to referred page