summaryrefslogtreecommitdiffstats
path: root/src/stk.c
diff options
context:
space:
mode:
authorJeevaka Badrappan <jeevaka.badrappan@elektrobit.com>2010-12-27 21:07:02 +0200
committerDenis Kenzior <denkenz@gmail.com>2010-12-27 15:06:08 -0600
commit1e5d29012ba4c410084239d30527e67713c25ce4 (patch)
tree904fbf167a32c986d9dbf92e7e8d27ffdce79b11 /src/stk.c
parent8d9f4e0caeea734c3f5eb41a17765f1c630524f4 (diff)
downloadofono-1e5d29012ba4c410084239d30527e67713c25ce4.tar.bz2
stk: fix issue in set up menu handling
Diffstat (limited to 'src/stk.c')
-rw-r--r--src/stk.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/stk.c b/src/stk.c
index 9dcbda64..5e5c2e4a 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1093,26 +1093,28 @@ static gboolean handle_command_set_up_menu(const struct stk_command *cmd,
struct stk_response *rsp,
struct ofono_stk *stk)
{
- gboolean modified = FALSE;
+ struct stk_menu *menu = NULL;
- if (stk->main_menu) {
- stk_menu_free(stk->main_menu);
- stk->main_menu = NULL;
+ if (cmd->setup_menu.items) {
+ menu = stk_menu_create_from_set_up_menu(cmd);
- modified = TRUE;
+ if (menu == NULL) {
+ rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ return TRUE;
+ }
}
- if (cmd->setup_menu.items) {
- stk->main_menu = stk_menu_create_from_set_up_menu(cmd);
+ if (menu == NULL && stk->main_menu == NULL)
+ return TRUE;
- if (stk->main_menu)
- modified = TRUE;
- else
- rsp->result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ if (stk->main_menu) {
+ stk_menu_free(stk->main_menu);
+ stk->main_menu = NULL;
}
- if (modified)
- emit_menu_changed(stk);
+ stk->main_menu = menu;
+
+ emit_menu_changed(stk);
return TRUE;
}