Fix #1815 - fix aei null deref