From 413c200dfb0fd2cb472e95bb3753e08e10cd0c9e Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 11 Oct 2010 20:12:26 -0500 Subject: simfs: Make image cache logic a bit easier to read --- src/simfs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/simfs.c') diff --git a/src/simfs.c b/src/simfs.c index 5fbee8b9..6865230d 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -732,12 +732,13 @@ void sim_fs_cache_image(struct sim_fs *fs, const char *image, int id) return; imsi = ofono_sim_get_imsi(fs->sim); - phase = ofono_sim_get_phase(fs->sim); + if (imsi == NULL) + return; - if (imsi) - write_file((const unsigned char *) image, strlen(image), - SIM_CACHE_MODE, SIM_IMAGE_CACHE_PATH, imsi, - phase, id); + phase = ofono_sim_get_phase(fs->sim); + write_file((const unsigned char *) image, strlen(image), + SIM_CACHE_MODE, SIM_IMAGE_CACHE_PATH, imsi, + phase, id); } char *sim_fs_get_cached_image(struct sim_fs *fs, int id) -- cgit v1.2.3