Don't break compatibility (PY-11499).
Fix NPE.