Index: data/CRMEntity.php
===================================================================
--- data/CRMEntity.php	(revision 13354)
+++ data/CRMEntity.php	(working copy)
@@ -1625,6 +1625,7 @@
 	 */
 	function save_related_module($module, $crmid, $with_module, $with_crmid) {
 		global $adb;
+                if (strlen($crmid)==0) return;
 		if(!is_array($with_crmid)) $with_crmid = Array($with_crmid);
 		foreach($with_crmid as $relcrmid) {
 			