BeelGroup / Docear-Desktop

Docear's desktop version (GPL)
298 stars 90 forks source link

fixed URI not absolute exception on "Add existing reference" action #428

Open stlanger opened 10 years ago

stlanger commented 10 years ago

see http://www.docear.org/support/forums/docear-support-forums-group3/bug-reports-forum6/add-existing-reference-fails-when-node-already-had-a-link-thread989/ for details:

Steps to reproduce:

  1. Open a new mindmap
  2. Add two nodes to the mindmap
  3. Add a link from node 1 to node 2 (I did this with "Set anchor" at node 2 and "Link to anchor" at node 1)
  4. Click "References"->"Add existing reference" at node 1 -> Nothing happens, but the log gets filled with errors
stlanger commented 10 years ago

happens because of node's reference being converted to url (MModeWorkspaceUrlManager):

        URI preResolved = getAbsoluteURI(uri);
        if(base == null || preResolved == null) {
            if(preResolved != null) {
                return preResolved.toURL();
            }
            return null;
        }

preResolved has a format like this: "#1234"