Fixing potential exception when NotifyActivity is not configured

This commit is contained in:
Sebastien Ros 2013-08-23 17:07:33 -07:00
parent b8f97cd0a7
commit 6fe6b5afce

View File

@ -43,7 +43,8 @@ namespace Orchard.Workflows.Activities {
var notification = activityContext.GetState<string>("Notification");
var message = activityContext.GetState<string>("Message");
var notificationType = (NotifyType)Enum.Parse(typeof(NotifyType), notification);
NotifyType notificationType;
Enum.TryParse(notification, true, out notificationType);
_notifier.Add(notificationType, T(message));
yield return T("Done");