minor - NPE check.

This commit is contained in:
Heng Sin Low 2013-08-23 10:25:34 +08:00
parent 49d501692c
commit 363b1be214
1 changed files with 5 additions and 1 deletions

View File

@ -542,7 +542,9 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
Toolbar toolbar = (Toolbar) tabpanel.getFirstChild();
IADTabpanel adtab = getADTabpanel(index);
if (adtab!=null && (adtab.getGridTab().isSortTab() || adtab.getGridTab().isReadOnly()))
if (adtab == null)
return;
if (adtab.getGridTab().isSortTab() || adtab.getGridTab().isReadOnly())
readOnly = true;
boolean insertRecord = !readOnly;
@ -554,6 +556,8 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
boolean enableDelete = !changed && !readOnly && !adtab.getGridTab().isSortTab();
ADWindow adwindow = ADWindow.findADWindow(this);
if (adwindow == null)
return;
List<String> tabRestrictList = adwindow.getTabToolbarRestrictList(adtab.getGridTab().getAD_Tab_ID());
List<String> windowRestrictList = adwindow.getWindowToolbarRestrictList();