Fixed error where class attributes are printed, when item is null (item array is empty)