Check for null on core file and remove if()free