Fix also possible nullptr memory access. Refs #52750 Change-Id: I8caa34ccf1c5b23a8ae8b1072751e22e24ca4043