Fix JS error when no data is passed to an event

Change-Id: I55aac61c930fb7f275017d6015ac6a0568cbbd7d
Merge "Fix JS error when no data is passed to an event"