|
Re: ContentProvider for TableViewer Problem [message #459920 is a reply to message #459861] |
Thu, 18 August 2005 17:09 |
Eclipse User |
|
|
|
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.03617 seconds