 
 Template.loginServices.events
 	'click .external-login': (e, t)->
-		return unless this.service?
+		return unless this.service?.service?
 
 		loadingIcon = $(e.currentTarget).find('.loading-icon')
 		serviceIcon = $(e.currentTarget).find('.service-icon')


				FlowRouter.go 'index'
		else
			loginWithService = "loginWith" + (if this.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service))
			serviceConfig = {}
			Meteor[loginWithService] serviceConfig, (error) ->
				loadingIcon.addClass 'hidden'

		serviceIcon.addClass 'hidden'

		# login with native facebook app
		if Meteor.isCordova and this.service.service is 'facebook'
			Meteor.loginWithFacebookCordova {}, (error) ->
				loadingIcon.addClass 'hidden'
				serviceIcon.removeClass 'hidden'
