fix npe with -ea enabled