Fix crash when there are no screen events