--- ./formats/vformats-xml/xml-vcal.c.orig	2007-09-27 23:24:54.000000000 +0100
+++ ./formats/vformats-xml/xml-vcal.c	2007-09-28 01:13:04.000000000 +0100
@@ -2008,8 +2008,6 @@
 	int duration;
 	osync_bool isruntime = FALSE;
 
-	VFormatAttribute *attr = vformat_attribute_new(NULL, "DALARM");
-
 	dtstart = osxml_get_node(root->parent, "DateStarted"); 
 	value = osxml_find_node(dtstart, "Value");
 
@@ -2025,7 +2023,7 @@
 	if (isruntime) {
 		runtime = startvtime; 
 	/* Duration */	
-	} else {
+	} else if (trigger) {
 		tmp = osxml_find_node(trigger, "Content");
 		duration = osync_time_alarmdu2sec(tmp);
 		g_free(tmp);
@@ -2047,29 +2045,32 @@
 
 	g_free(value);
 
-	vformat_attribute_add_value(attr, runtime);
+	VFormatAttribute *attr = vformat_attribute_new(NULL, "DALARM");
+	if (runtime) {
+		vformat_attribute_add_value(attr, runtime);
 	
-	add_value(attr, root, "AlarmDuration", encoding);
-	add_value(attr, root, "AlarmRepeat", encoding);
-	add_value(attr, root, "AlarmDescription", encoding);
-
-	action = osxml_find_node(root, "AlarmAction");
-	if (action) {
-		if (!strcmp(action, "AUDIO")) {
-			osync_trace(TRACE_INTERNAL, "Handling audo reminder xml attribute");
-
-			attr = vformat_attribute_new(NULL, "AALARM");
-			vformat_attribute_add_value(attr, runtime);
-			add_value(attr, root, "AlarmDuration", encoding);
-			add_value(attr, root, "AlarmRepeat", encoding);
-			add_value(attr, root, "AlarmDescription", encoding);
+		add_value(attr, root, "AlarmDuration", encoding);
+		add_value(attr, root, "AlarmRepeat", encoding);
+		add_value(attr, root, "AlarmDescription", encoding);
+		
+		action = osxml_find_node(root, "AlarmAction");
+		if (action) {
+			if (!strcmp(action, "AUDIO")) {
+				osync_trace(TRACE_INTERNAL, "Handling audo reminder xml attribute");
+		
+				attr = vformat_attribute_new(NULL, "AALARM");
+				vformat_attribute_add_value(attr, runtime);
+				add_value(attr, root, "AlarmDuration", encoding);
+				add_value(attr, root, "AlarmRepeat", encoding);
+				add_value(attr, root, "AlarmDescription", encoding);
+			}
 		}
+		
+		vformat_add_attribute(vcard, attr);
+		g_free(action);
+		g_free(runtime);
+		
 	}
-
-	vformat_add_attribute(vcard, attr);
-	g_free(action);
-	g_free(runtime);
-
 	return attr;
 }
 /* end of vcal only */

