Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] [jira] Created: (UDIG-1345) RenderManagerAdapters NPE

RenderManagerAdapters NPE
-------------------------

                 Key: UDIG-1345
                 URL: http://jira.codehaus.org/browse/UDIG-1345
             Project: uDIG
          Issue Type: Bug
          Components: API render
    Affects Versions: UDIG 1.1 RC13
         Environment: Assumed to be UDIG 1.1 RC13? But not really sure...
            Reporter: Jody Garnett
            Assignee: Jesse Eichar


Reported on the email list by Leigh Fitzgibbon.
{panel}
I just ran into this error:

java.lang.NullPointerException
	at
net.refractions.udig.project.ui.internal.RenderManagerAdapters$1.notifyChang
ed(RenderManagerAdapters.java:59)
	at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierIm
pl.java:247)
	at
net.refractions.udig.project.internal.render.impl.ViewportModelImpl.fireNoti
fication(ViewportModelImpl.java:1001)
	at
net.refractions.udig.project.internal.render.impl.ViewportModelImpl.setBound
s(ViewportModelImpl.java:365)
	at
net.refractions.udig.project.internal.render.impl.ViewportModelImpl.zoomToBo
x(ViewportModelImpl.java:1055)
	at
net.refractions.udig.project.internal.render.impl.ViewportModelImpl.setBound
s(ViewportModelImpl.java:360)
	at
net.refractions.udig.project.internal.command.navigation.SetViewportBBoxComm
and.runImpl(SetViewportBBoxCommand.java:108)
	at
net.refractions.udig.project.internal.command.navigation.AbstractNavCommand.
run(AbstractNavCommand.java:48)
	at
net.refractions.udig.project.command.CommandManager$Executor.execute(Command
Manager.java:400)
	at
net.refractions.udig.project.command.CommandManager$Executor.run(CommandMana
ger.java:325)
	at
net.refractions.udig.project.command.CommandManager$Executor.run(CommandMana
ger.java:311)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)



Which is caused by the following code because the active editor is null:


                    if( ApplicationGISInternal.getActiveEditor().isVisible()
)
                        refreshDirtyArea(msg);
                    break;


Regards,
Leigh
{panel}

The following patch will fix this:
{code}
            public void notifyChanged( Notification msg ) {
                manager.checkState();
                switch( msg.getFeatureID(ViewportModel.class) ) {
                case RenderPackage.VIEWPORT_MODEL__BOUNDS: {
                    MapEditor activeEditor = ApplicationGISInternal.getActiveEditor();
                    if( activeEditor != null && activeEditor.isVisible() )
                        refreshDirtyArea(msg);
                    break;
                }
                case RenderPackage.VIEWPORT_MODEL__CRS: {
                    manager.refresh(null);
                    break;
                }
                }// switch
            }
{code}

I am not sure if I should commit; it may only mask a real problem - I would need more informaiton (and someone to test) to be sure.
Hopefully more information will be provided.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Back to the top