Modify

Opened 4 years ago

Closed 4 years ago

#19355 closed defect (fixed)

NPE at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowserModel.canReload()

Reported by: GerdP Owned by: GerdP
Priority: normal Milestone: 20.06
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. Make sure that preference multipoly.show-relation-editor is set to true
  2. draw new closed way
  3. select existing way which is a member of a multipolygon relation
  4. Update multipolygon (Ctrl+Shift+B)

What is the expected result?

Relation Editor is shown with the freshly updated multipolygon

What happens instead?

error popup

Please provide any additional information below. Attach a screenshot if possible.

Found this while looking at #19346

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-06-02 08:27:29 +0200 (Tue, 02 Jun 2020)
Build-Date:2020-06-02 11:11:35
Revision:16538
Relative:URL: ^/trunk

Identification: JOSM/1.5 (16538 en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1903 (18362)
Memory Usage: 937 MB / 3641 MB (552 MB allocated, but free)
Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-XX:StartFlightRecording=name=MyRecording2,settings=d:\dbg\gerd.jfc, -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=e:\ld\perf_20200607_113718.jfr]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (35414)
+ apache-commons (35362)
+ buildings_tools (35474)
+ continuosDownload (91)
+ ejml (35313)
+ geotools (35169)
+ jaxb (35092)
+ jts (35122)
+ merge-overlap (35248)
+ o5m (35248)
+ opendata (35405)
+ pbf (35446)
+ poly (35248)
+ reverter (35474)
+ undelete (35474)
+ utilsplugin2 (35476)

Validator rules:
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- E: Handled by bug report queue: java.lang.NullPointerException
- E: Handled by bug report queue: java.lang.NullPointerException


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (21) of main
java.lang.NullPointerException
	at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowserModel.canReload(ReferringRelationsBrowserModel.java:107)
	at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowser$ReloadAction.refreshEnabled(ReferringRelationsBrowser.java:115)
	at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowser$ReloadAction.<init>(ReferringRelationsBrowser.java:111)
	at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowser.build(ReferringRelationsBrowser.java:80)
	at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowser.<init>(ReferringRelationsBrowser.java:53)
	at org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor.<init>(GenericRelationEditor.java:237)
	at org.openstreetmap.josm.gui.dialogs.relation.RelationEditor.getEditor(RelationEditor.java:81)
	at org.openstreetmap.josm.actions.CreateMultipolygonAction$CreateUpdateMultipolygonTask.lambda$run$0(CreateMultipolygonAction.java:128)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Attachments (0)

Change History (3)

comment:1 by GerdP, 4 years ago

Description: modified (diff)
Milestone: 20.06
Owner: changed from team to GerdP
Status: newassigned

comment:2 by GerdP, 4 years ago

Description: modified (diff)

comment:3 by GerdP, 4 years ago

Resolution: fixed
Status: assignedclosed

In 16554/josm:

fix #19355: NPE at org.openstreetmap.josm.gui.dialogs.relation.ReferringRelationsBrowserModel.canReload()

  • don't use relation created by createMultipolygonCommand as it was not yet added to the dataset
  • get the correct relation after command was executed

(maybe RelationEditor.getEditor() is the better place to do this, adding a null check in canReload() makes no sense as other methods also cannot handle a relation without dataset)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.