Fix null pointer in build