only set itemContext and itemAttributes if item != null