Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12442 closed defect (fixed)

[patch] save session as caused NPE when there were no layers

Reported by: kolesar Owned by: team
Priority: normal Milestone: 16.02
Component: Core Version:
Keywords: template_report Cc:


What steps will reproduce the problem?

  1. Create a new layer.
  2. Delete that layer. MOTD appears again.

What is the expected result?

File / Save Session As... menu item gets inactive.

What happens instead?

File / Save Session As... menu item is still active, selecting causes NPE.

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

Attached patch that fixes NPE by disabling this menu item when there are no layers by implementing MapFrameListener in SessionSaveAsAction.

Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-01-06 17:30:31 +0100 (Wed, 06 Jan 2016)
Build-Date:2016-01-06 16:32:31
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9329 en) Linux Ubuntu 14.04.3 LTS
Memory Usage: 167 MB / 910 MB (87 MB allocated, but free)
Java version: 1.7.0_85, Oracle Corporation, OpenJDK Server VM
Java package: openjdk-7-jre:i386-7u85-2.6.1-5ubuntu0.14.04.1

Last errors/warnings:
- W: Cannot lock cache directory. Will not use disk cache
- E: java.lang.NullPointerException

	at org.openstreetmap.josm.actions.SessionSaveAsAction$SessionSaveAsDialog.initialize(
	at org.openstreetmap.josm.actions.SessionSaveAsAction$SessionSaveAsDialog.<init>(
	at org.openstreetmap.josm.actions.SessionSaveAsAction.saveSession(
	at org.openstreetmap.josm.actions.SessionSaveAsAction.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.AbstractButton.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.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)

SessionSaveAsMapFrameListener.patch (1.8 KB) - added by kolesar 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by kolesar

comment:1 Changed 8 years ago by bastiK

Resolution: fixed
Status: newclosed

In 9629/josm:

applied #12442 - fix: save session as caused NPE when there were no layers (patch by kolesar)

comment:2 Changed 8 years ago by bastiK

Milestone: 16.02


Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.