Uploaded image for project: 'Directory Studio'
  1. Directory Studio
  2. DIRSTUDIO-1047

No BrowserViewUniversalListener.connectionOpened null checks

    Details

      Description

      BrowserViewUniversalListener.connectionOpened is fired on the opening of a connection. In my case, the connection being opened comes from a wizard displaying the BrowserWidget rather than the BrowserView. In this use-case, the BrowserConnection used in the wizard is only temporary so not added to the BrowserCorePlugin ConnectionManager.

      Consequently, opening a connection in the wizard while the BrowserView is also open, the latter's BrowserViewUniversalListener.connectionOpened() is fired and a NPE results.

      A check can be added to assert that the BrowserConnection fetched from the ConnectionManager is not null. Only if not null should the BrowserView viewer be refreshed.

        Activity

        Hide
        seelmann Stefan Seelmann added a comment -

        Thanks Paul for the report. Can you provide a patch?

        I assume there are more places where the BrowserConnection is fetched and may be null.

        Show
        seelmann Stefan Seelmann added a comment - Thanks Paul for the report. Can you provide a patch? I assume there are more places where the BrowserConnection is fetched and may be null.
        Hide
        phantomjinx Paul Richardson added a comment -

        Patch for safeguarding browser connections when a connection event is fired.

        I have checked all the iimplementations of ConnectionUpdateListener and the patch addresses those that might have an issue.

        Show
        phantomjinx Paul Richardson added a comment - Patch for safeguarding browser connections when a connection event is fired. I have checked all the iimplementations of ConnectionUpdateListener and the patch addresses those that might have an issue.
        Hide
        seelmann Stefan Seelmann added a comment -

        Thanks Paul for the patch. I just added an additional null check in LdifEditor otherwise I got an NPE when opening the LDIF editor. Applied here: http://svn.apache.org/r1681860

        Show
        seelmann Stefan Seelmann added a comment - Thanks Paul for the patch. I just added an additional null check in LdifEditor otherwise I got an NPE when opening the LDIF editor. Applied here: http://svn.apache.org/r1681860

          People

          • Assignee:
            Unassigned
            Reporter:
            phantomjinx Paul Richardson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development