Index: trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 749)
+++ trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 750)
@@ -23,6 +23,6 @@
 public final class PasteTagsAction extends JosmAction implements SelectionChangedListener {
 
-    public PasteTagsAction(JosmAction copyAction) {
-    	super(tr("Paste Tags"), "pastetags",
+	public PasteTagsAction(JosmAction copyAction) {
+		super(tr("Paste Tags"), "pastetags",
 			tr("Apply tags of contents of paste buffer to all selected items."),
 			KeyEvent.VK_V, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK, true);
@@ -30,22 +30,26 @@
 		copyAction.addListener(this);
 		setEnabled(false);
-    }
+	}
 
-    private void pasteKeys(Collection<Command> clist, Collection<? extends OsmPrimitive> pasteBufferSubset, Collection<OsmPrimitive> selectionSubset) {
-		/* scan the paste buffer, and add tags to each of the selected objects. 
+	private void pasteKeys(Collection<Command> clist, Collection<? extends OsmPrimitive> pasteBufferSubset, Collection<OsmPrimitive> selectionSubset) {
+		/* scan the paste buffer, and add tags to each of the selected objects.
 		 * If a tag already exists, it is overwritten */
 		if (selectionSubset != null && ! selectionSubset.isEmpty()) {
 			for (Iterator<? extends OsmPrimitive> it = pasteBufferSubset.iterator(); it.hasNext();) {
 				OsmPrimitive osm = it.next();
-				for (String key : osm.keys.keySet()) {
-					if (! key.equals("created_by"))
-						clist.add(new ChangePropertyCommand(selectionSubset, key, osm.keys.get(key)));
+				Map<String, String> m = osm.keys;
+				if(m != null)
+				{
+					for (String key : m.keySet()) {
+						if (! key.equals("created_by"))
+							clist.add(new ChangePropertyCommand(selectionSubset, key, osm.keys.get(key)));
+					}
 				}
 			}
-		}    	
-    }
-    
-    public void actionPerformed(ActionEvent e) {
-		Collection<Command> clist = new LinkedList<Command>();		
+		}
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		Collection<Command> clist = new LinkedList<Command>();
 		pasteKeys(clist, Main.pasteBuffer.nodes, Main.ds.getSelectedNodes());
 		pasteKeys(clist, Main.pasteBuffer.ways, Main.ds.getSelectedWays());
@@ -54,6 +58,6 @@
 		Main.ds.setSelected(Main.ds.getSelected()); // to force selection listeners, in particular the tag panel, to update
 		Main.map.mapView.repaint();
-    }
-    
+	}
+
 	private boolean containsSameKeysWithDifferentValues(Collection<? extends OsmPrimitive> osms) {
 		Map<String,String> kvSeen = new HashMap<String,String>();
@@ -71,31 +75,31 @@
 					return true;
 			}
-		}		
+		}
 		return false;
 	}
-	
+
 	/**
-	 * Determines whether to enable the widget depending on the contents of the paste 
-	 * buffer and current selection 
+	 * Determines whether to enable the widget depending on the contents of the paste
+	 * buffer and current selection
 	 * @param pasteBuffer
 	 */
 	private void possiblyEnable(Collection<? extends OsmPrimitive> selection, DataSet pasteBuffer) {
-		/* only enable if there is something selected to paste into and 
+		/* only enable if there is something selected to paste into and
 			if we don't have conflicting keys in the pastebuffer */
 		setEnabled(selection != null &&
 				! selection.isEmpty() &&
-				! pasteBuffer.allPrimitives().isEmpty() && 
+				! pasteBuffer.allPrimitives().isEmpty() &&
 				(Main.ds.getSelectedNodes().isEmpty() ||
-					! containsSameKeysWithDifferentValues(pasteBuffer.nodes)) && 
+					! containsSameKeysWithDifferentValues(pasteBuffer.nodes)) &&
 				(Main.ds.getSelectedWays().isEmpty() ||
-					! containsSameKeysWithDifferentValues(pasteBuffer.ways)) && 
+					! containsSameKeysWithDifferentValues(pasteBuffer.ways)) &&
 				(Main.ds.getSelectedRelations().isEmpty() ||
 					! containsSameKeysWithDifferentValues(pasteBuffer.relations)));
 	}
-	
+
 	@Override public void pasteBufferChanged(DataSet newPasteBuffer) {
 		possiblyEnable(Main.ds.getSelected(), newPasteBuffer);
 	}
-	
+
 	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
 		possiblyEnable(newSelection, Main.pasteBuffer);
