fs->op_source = g_idle_add(sim_fs_op_read_record, fs);
}
- if (imsi == NULL || cache == FALSE)
+ if (imsi == NULL || phase == OFONO_SIM_PHASE_UNKNOWN || cache == FALSE)
return;
memset(fileinfo, 0, SIM_CACHE_HEADER_SIZE);
return;
phase = ofono_sim_get_phase(fs->sim);
+ if (phase == OFONO_SIM_PHASE_UNKNOWN)
+ return;
+
write_file((const unsigned char *) image, strlen(image),
SIM_CACHE_MODE, SIM_IMAGE_CACHE_PATH, imsi,
phase, id);