|
Re: ContentProvider for TableViewer Problem [message #459920 is a reply to message #459861] |
Thu, 18 August 2005 17:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"James Leotta" <jleotta@bascom.com> wrote in message
news:de2cds$mhv$1@news.eclipse.org...
> This return in the method within a ContentProvider
>
> public Object[] getElements(Object inputElement) (
> return inputElement.getCases().toArray();
>
>
> needs to be replaced with something not using the parameter inputElement
> like
> return caseList.getCases().toArray();
>
> because the method gets called before setInput is called causing a null
> pointer exception. It would seem that the getElements method should not
> be called until setInput is called. Am I missing something?
Yes you are.
You should check for nulls in the getElements() method.
If inputElement == null, then return null.
---
Sunil
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03456 seconds