avoid null pointer exception (regression from [31193]), refs #16730