efl_ui_win: add validation check to return legacy default value

Summary:
elm_win_type_get needs to return ELM_WIN_UNKNOWN when
invalid object comes.

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10187
This commit is contained in:
WooHyun Jung 2019-09-26 08:59:28 -04:00 committed by Mike Blumenkrantz
parent 8197fee189
commit ddb28ccdf1
1 changed files with 4 additions and 0 deletions

View File

@ -9392,6 +9392,10 @@ elm_win_name_get(const Evas_Object *obj)
EAPI Elm_Win_Type
elm_win_type_get(const Evas_Object *obj)
{
if (!(efl_isa(obj, EFL_UI_WIN_CLASS) ||
efl_isa(obj, EFL_UI_WIN_LEGACY_CLASS) ||
efl_isa(obj, EFL_UI_WIN_INLINED_CLASS))) return ELM_WIN_UNKNOWN;
return _efl_ui_win_type_to_elm_win_type(efl_ui_win_type_get(obj));
}