diskselector: Fix segmentation fault
authorJaeun Choi <jaeun12.choi@samsung.com>
Mon, 3 Mar 2014 09:10:47 +0000 (18:10 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 3 Mar 2014 09:12:34 +0000 (18:12 +0900)
commitec8ef6518d483207a5e4a065f63fe7277cb92829
tree907afb26f51930fea572e978771b810076a8ea0e
parente935bad365e7e7056b57412ee84f052fce2a3dc4
diskselector: Fix segmentation fault

Summary:
The code was missing null check of sd->items list.
If the deleted item is the only item of the list,
sd->items becomes empty after removing it.
In that case, sd->selected_item should be set as NULL.
@fix
Fixes T988

Test Plan: execute diskselector_example_02 > click "Delete item" button 3 times

Reviewers: raster, seoz

Reviewed By: seoz

CC: seoz
Maniphest Tasks: T988

Differential Revision: https://phab.enlightenment.org/D595
src/lib/elm_diskselector.c