Fix null related error