[Logic] Fix NPE.