From dd308f6be19fea16bf6009f5d9d60942ff7e9523 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 6 Nov 2014 14:00:47 +0800 Subject: [PATCH] allow closing non-existent widget but throw a warning --- frontend/ui/uimanager.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/ui/uimanager.lua b/frontend/ui/uimanager.lua index 2656d9f66..a3730fc7c 100644 --- a/frontend/ui/uimanager.lua +++ b/frontend/ui/uimanager.lua @@ -153,6 +153,10 @@ end -- unregister a widget function UIManager:close(widget) + if not widget then + DEBUG("widget not exist to be closed") + return + end DEBUG("close widget", widget.id) Input.disable_double_tap = DGESDETECT_DISABLE_DOUBLE_TAP local dirty = false