Opened 8 years ago

Closed 8 years ago

#12443 closed defect (fixed)

[patch] adding member to a new relation causes NPE

Reported by: kolesar Owned by: Don-vip
Priority: major Milestone: 16.02
Component: Core Version:
Keywords: template_report regression Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Draw something, for example a untagged node. Keep it selected.
  2. Create a new relation.
  3. Add selection to the new relation.

What is the expected result?

Selection is added to the relation.

What happens instead?

NullPointerException (@since r9588)

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

Attached patch that checks if given relation is null.

Build-Date:2016-01-25 13:33:40

Identification: JOSM/1.5 (9629 SVN en) Linux Ubuntu 14.04.3 LTS
Memory Usage: 207 MB / 910 MB (114 MB allocated, but free)
Java version: 1.7.0_85-b01, Oracle Corporation, OpenJDK Server VM
Java package: openjdk-7-jre:i386-7u85-2.6.1-5ubuntu0.14.04.1
Program arguments: [/home/kolesar/személyes/osm/napi/20160115/relation.osm.gz]
Dataset consistency test: No problems found

Last errors/warnings:
- E: java.lang.NullPointerException
- E: java.lang.NullPointerException

	at org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType.forPrimitive(
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.getRelationMemberForPrimitive(
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtIndex(
	at org.openstreetmap.josm.gui.dialogs.relation.MemberTableModel.addMembersAtEnd(
	at org.openstreetmap.josm.gui.dialogs.relation.actions.AddSelectedAtEndAction.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
	at java.awt.AWTEventMulticaster.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.EventQueue.dispatchEventImpl(
	at java.awt.EventQueue.access$300(
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue$
	at java.awt.EventQueue$
	at Method)
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

Attachments (1)

MemberTableModelFix.patch (1.6 KB ) - added by kolesar 8 years ago.

Download all attachments as: .zip

Change History (4)

by kolesar, 8 years ago

Attachment: MemberTableModelFix.patch added

comment:1 by anonymous, 8 years ago

I can confirm this issue.

comment:2 by Don-vip, 8 years ago

Description: modified (diff)
Keywords: regression added
Milestone: 16.02
Owner: changed from team to Don-vip
Status: newassigned

comment:3 by Don-vip, 8 years ago

Resolution: fixed
Status: assignedclosed

In 9632/josm:

fix #12443 - NPE (regression from r9588, see #12412)

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Don-vip.
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.