IDEMPIERE-3048:Wrong type when get AdWindow instance

This commit is contained in:
hieplq 2016-03-03 02:41:01 +07:00
parent 38bebf5f3f
commit ee89ebbd26
1 changed files with 5 additions and 1 deletions

View File

@ -219,7 +219,11 @@ public class ADWindow extends AbstractUIPart
* @return adwindow instance for windowNo ( if any )
*/
public static ADWindow get(int windowNo) {
return (ADWindow) SessionManager.getAppDesktop().findWindow(windowNo);
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
if (window != null && window instanceof ADWindow)
return (ADWindow) SessionManager.getAppDesktop().findWindow(windowNo);
return null;
}
/**