Added null check when setting input component