Index: ../trunk-jpl/src/m/mesh/patchglobe.m
===================================================================
--- ../trunk-jpl/src/m/mesh/patchglobe.m	(revision 20538)
+++ ../trunk-jpl/src/m/mesh/patchglobe.m	(revision 20539)
@@ -6,6 +6,14 @@
 	%recover basic options:
 	bandwidth=getfieldvalue(options,'bandwidth',100000);
 
+	%some checks on the mesh: 
+	if (isempty(mh.x) | isempty(mh.y) | isempty(mh.z) | isempty(mh.lat) | isempty(mh.long) | isempty(mh.r) ) 
+		error('patchglobe error message: 3D planet mesh has one of the following empty: ''x'',''y'',''z'',''lat'',''long'' or ''r''');
+	end
+	if (isempty(mh2d.x) | isempty(mh2d.y) | isempty(mh2d.lat) | isempty(mh2d.long)) 
+		error('patchglobe error message: 3D planet mesh has one of the following empty: ''x'',''y'',''lat'' or ''long''');
+	end
+
 	%give ourselves a unique temporary directory: 
 	temproot=tempname; mkdir(temproot);
 
