Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 761)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java	(revision 762)
@@ -302,8 +302,9 @@
 		AudioMarker newAudioMarker = AudioMarker.create(Main.proj.eastNorth2latlon(en), 
 			AudioMarker.inventName(offset), AudioPlayer.url().toString(), this, time, offset);
-		
+
 		// insert it at the right place in a copy the collection
 		Collection<Marker> newData = new ArrayList<Marker>();
-		am = null; 
+		am = null;
+		AudioMarker ret = newAudioMarker; // save to have return value
 		for (Marker m : data) {
 			if (m.getClass() == AudioMarker.class) {
@@ -317,14 +318,15 @@
 			newData.add(m);
 		}
+
 		if (newAudioMarker != null) {
 			if (am != null)
-				newAudioMarker.adjustOffset(am.syncOffset()); // i.e. same as predecessor				
+				newAudioMarker.adjustOffset(am.syncOffset()); // i.e. same as predecessor
 			newData.add(newAudioMarker); // insert at end
 		}
-		
+
 		// replace the collection
 		data.clear();
 		data.addAll(newData);
-		return newAudioMarker;
+		return ret;
 	}
 	
Index: trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 761)
+++ trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java	(revision 762)
@@ -220,11 +220,13 @@
 	 */
 	public void synchronize(EastNorth en) {
+		AudioMarker recent = AudioMarker.recentlyPlayedMarker();
+		if(recent == null)
+			return;
 		/* First, see if we dropped onto an existing audio marker in the layer being played */
 		Point startPoint = Main.map.mapView.getPoint(en);
-		AudioMarker ca = null; 
-		AudioMarker recent = AudioMarker.recentlyPlayedMarker(); 		
-		if (recent != null || recent.parentLayer != null) {
+		AudioMarker ca = null;
+		if (recent.parentLayer != null) {
 			double closestAudioMarkerDistanceSquared = 1.0E100;
-			for (Marker m : AudioMarker.recentlyPlayedMarker().parentLayer.data) {
+			for (Marker m : recent.parentLayer.data) {
 				if (m instanceof AudioMarker) {
 					double distanceSquared = m.eastNorth.distanceSq(en);
@@ -239,8 +241,8 @@
 		/* We found the closest marker: did we actually hit it? */
 		if (ca != null && ! ca.containsPoint(startPoint)) ca = null;
-		
+
 		/* If we didn't hit an audio marker, we need to create one at the nearest point on the track */
-		if (ca == null && recent != null) {
-			/* work out EastNorth equivalent of 50 (default) pixels tolerance */ 
+		if (ca == null) {
+			/* work out EastNorth equivalent of 50 (default) pixels tolerance */
 			Point p = Main.map.mapView.getPoint(en);
 			EastNorth enPlus25px = Main.map.mapView.getEastNorth(p.x+dropTolerance, p.y);
@@ -255,6 +257,11 @@
 
 		/* Actually do the synchronization */
-		if (recent.parentLayer.synchronizeAudioMarkers(ca)) {
-			JOptionPane.showMessageDialog(Main.parent, tr("Audio synchronized at point ") + ca.text);
+		if(ca == null)
+		{
+			JOptionPane.showMessageDialog(Main.parent,tr("Unable to create new Audio marker."));
+			endDrag(true);
+		}
+		else if (recent.parentLayer.synchronizeAudioMarkers(ca)) {
+			JOptionPane.showMessageDialog(Main.parent, tr("Audio synchronized at point {0}.", ca.text));
 			eastNorth = ca.eastNorth;
 			endDrag(false);
