PDA

View Full Version : TreeModel in TreeGrid accepting null child



Km.kanagaraj
3 Jun 2010, 8:22 PM
I am using GWT 2.0 and GXT 2.1

I am using TreeGrid to show some list of configuration, each config will have their own child items

unknowingly i tried to add a null child to a parent config. But the compiler not giving the proper message. It throws a Null pointer exception in some where else.

in adopt(child)->getParentInternal() while checking for the parent its throwing the exception.

Its very complex to identify what is the exact problem. Please fix it

sven
4 Jun 2010, 1:23 AM
Null models are not supported and lead to unexpected behaviours

Km.kanagaraj
4 Jun 2010, 1:31 AM
Null models are not supported and lead to unexpected behaviours

Yes, you are correct

but it doesn't have proper notification,


14:58:34.508 [ERROR] [mast] Uncaught exception escaped
java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.data.BaseTreeModel.getParentInternal(BaseTreeModel.java:204)
at com.extjs.gxt.ui.client.data.BaseTreeModel.adopt(BaseTreeModel.java:209)
at com.extjs.gxt.ui.client.data.BaseTreeModel.insert(BaseTreeModel.java:116)
at com.extjs.gxt.ui.client.data.BaseTreeModel.add(BaseTreeModel.java:62)
at com.alert.AlertsConfigSummaryPanel$9.componentSelected(AlertsConfigSummaryPanel.java:293)

In AlertConfigSummaryPanel i have unknowingly added a null child to parent. But from the stack trace the i cant find my child is null, it is very difficult to find out

sven
4 Jun 2010, 1:34 AM
If you delete your important windows system files, windows also does not tell you that, it simple stops starting.


However, i will look so we add asserts for this. This is not really a bug, that is why it was moved out the correct place. Also for next time, oyu have to read the bugforum guidelines