#987 PyBreakpoint throws a NPE

1.4.7
closed-fixed
debugger (210)
5
2009-10-29
2009-10-13
No

the method PyBreakpoint#getFile thows a Null Pointer Exception when deleting the project from workspace. steps:
* Empty workspace, no interpreter defined yet
* Create helloworld python project
* Open source file, set some breakpoints
* Debug as local
* Close application
* Close src file
* Delete project --> NPE

Discussion

  • Fabrício Silva

    Fabrício Silva - 2009-10-13

    May be the method should check for null instance, anything like this:
    public String getFile() {
    IMarker marker = getMarker();
    IResource r = marker.getResource();
    if(r !=null && r.getLocation() != null && r instanceof IFile){
    return r.getLocation().toOSString();
    }else{
    //it's an external file...
    try {
    return (String) marker.getAttribute(PyBreakpoint.PY_BREAK_EXTERNAL_PATH_ID);
    } catch (CoreException e) {
    return null;
    }
    }
    }

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-10-29

    Traceback:

    java.lang.NullPointerException
    at org.python.pydev.debug.model.PyBreakpoint.getFile(PyBreakpoint.java:73)
    at org.python.pydev.debug.model.AbstractDebugTarget.breakpointRemoved(AbstractDebugTarget.java:278)
    at org.eclipse.debug.internal.core.BreakpointManager$BreakpointNotifier.run(BreakpointManager.java:928)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.debug.internal.core.BreakpointManager$BreakpointNotifier.notify(BreakpointManager.java:951)
    at org.eclipse.debug.internal.core.BreakpointManager.fireUpdate(BreakpointManager.java:865)
    at org.eclipse.debug.internal.core.BreakpointManager.removeBreakpoints(BreakpointManager.java:476)
    at org.eclipse.debug.internal.core.BreakpointManager$BreakpointManagerVisitor.update(BreakpointManager.java:718)
    at org.eclipse.debug.internal.core.BreakpointManager.resourceChanged(BreakpointManager.java:660)
    at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
    at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
    at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:297)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-10-29

    Fixed at git:

    %h 39414c9
    %ct 1256858559

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-10-29
    • status: open --> closed-fixed
     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-10-29

    Note: target version 1.5.1

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks