소스 검색

rtgui/widgets/window.c: check null reference on rtgui_container.focused

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1829 bbd45198-f89e-11dd-88c7-29a3b14d5316
chaos.proton@gmail.com 13 년 전
부모
커밋
57e2947cfc
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      components/rtgui/widgets/window.c

+ 2 - 1
components/rtgui/widgets/window.c

@@ -518,7 +518,8 @@ rt_bool_t rtgui_win_event_handler(struct rtgui_widget* widget, struct rtgui_even
 			if (win->modal_widget != RT_NULL)
 				return win->modal_widget->event_handler(win->modal_widget, event);
 		}
-		else if (RTGUI_CONTAINER(win)->focused != widget)
+		else if (RTGUI_CONTAINER(win)->focused != widget &&
+				 RTGUI_CONTAINER(win)->focused != RT_NULL)
 		{
 			RTGUI_CONTAINER(win)->focused->event_handler(RTGUI_CONTAINER(win)->focused, event);
 		}