Skip to content

Commit 8609e2a

Browse files
committed
Minor Bugfix
Solves #1
1 parent 5673e35 commit 8609e2a

File tree

10 files changed

+11
-6
lines changed

10 files changed

+11
-6
lines changed

notesolver/MANIFEST

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Plugin-Class: org.openstreetmap.josm.plugins.notesolver.NoteSolverPlug
77
in
88
Plugin-Description: Used for closing notes when uploading a changeset
99
and referencing them in each other's comments to keep references.
10-
Plugin-Date: 2020-05-14T06:58:47.130
10+
Plugin-Date: 2020-05-14T21:46:04.787
1111
Author: Kai Michael Poppe
1212
Plugin-Link: https://wiki.openstreetmap.org/wiki/User:Kmpoppe/Plugins#
1313
noteSolver
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

notesolver/src/org/openstreetmap/josm/plugins/notesolver/NoteSolverPlugin.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,15 @@ public void selectedNoteChanged(NoteData noteData) {
128128
for (JMenuItem menuItem : mainMenuEntries(menuTypes.MAIN))
129129
contextMenu.add(menuItem);
130130
Point p = MainApplication.getMainFrame().getMousePosition();
131-
contextMenu.setInvoker(MainApplication.getMainFrame().getComponentAt(p));
132-
contextMenu.setLocation(p);
133-
contextMenu.setEnabled(true);
134-
contextMenu.setVisible(true);
131+
if (p != null) {
132+
Component c = MainApplication.getMainFrame().getComponentAt(p);
133+
if (c != null) {
134+
contextMenu.setInvoker(c);
135+
contextMenu.setLocation(p);
136+
contextMenu.setEnabled(true);
137+
contextMenu.setVisible(true);
138+
}
139+
}
135140
}
136141
}
137142
@Override
@@ -331,7 +336,7 @@ private String getUrl(Object inputObject, Enum<linkTypes> linkType) {
331336
if (linkType == linkTypes.NOTE) {
332337
thisNumber = ((Note)inputObject).getId();
333338
} else if (linkType == linkTypes.CHANGESET) {
334-
thisNumber = (Long)inputObject;
339+
thisNumber = Integer.toUnsignedLong((Integer)inputObject);
335340
}
336341
if (thisNumber > 0L) {
337342
returnValue = serverUrl + linkType.name().toLowerCase() + "/" + Long.toString(thisNumber);

0 commit comments

Comments
 (0)