fix nullpointer if error event is null