[BZ-1082990] avoid NPE when trying to modify an expired event
(cherry picked from commit 14cae3411efc0c44e134b3fb06762f4e8b5744b0)