Fix generator NullPointer.