 
 		# Template._listForm.helpers(data.form.helpers)
 
-		Template._listRow.events(data.row.events)
+		Template._listRow.events(data?.row?.events)
 		if data.row?.helpers?
 			Template._listRow.helpers(data.row.helpers)
 
-		Template.lists.events(data.list.events)
+		Template.lists.events(data?.list?.events)
 
 
 
 		items = []
-		for item in data.items()
-			data = Object.reject(data, 'items')
-			item.context = data
-			items.add item
+		if data.items? and typeof data.items is 'function'
+			for item in data.items()
+				data = Object.reject(data, 'items')
+				item.context = data
+				items.add item
 
-		if items.length > 0
-			return items
+			if items.length > 0
+				return items
 
 Template._listRow.helpers
 	disabled: () ->


Handlebars.registerHelper 'ListForm', (data, context) ->
	fields = []
	providedFields = data.form.helpers.fields
	if not Array.isArray(providedFields)
		for key in Object.keys(providedFields)
			options = providedFields[key]

	selected: () ->
		context = this.context
		single = context.single
		if Session.get("selected-#{single}") is this._id
			return 'alert-info'

Template._listRow.events
	"click .close-form": () ->
