Admin : fix js errors when object is undefined or null.