diff --git a/src/Orchard.Web/Core/PublishLater/ViewModels/PublishLaterViewModel.cs b/src/Orchard.Web/Core/PublishLater/ViewModels/PublishLaterViewModel.cs index a0860ec68..67b8ff18f 100644 --- a/src/Orchard.Web/Core/PublishLater/ViewModels/PublishLaterViewModel.cs +++ b/src/Orchard.Web/Core/PublishLater/ViewModels/PublishLaterViewModel.cs @@ -33,7 +33,7 @@ namespace Orchard.Core.PublishLater.ViewModels { get { return IsPublished || ContentItem.ContentManager.Get(ContentItem.Id, VersionOptions.Published) != null; } } - public DateTime? VersionPublishedUtc { get { return ContentItem.As().VersionPublishedUtc; } } + public DateTime? VersionPublishedUtc { get { return ContentItem.As() == null ? null : ContentItem.As().VersionPublishedUtc; } } public DateTime? ScheduledPublishUtc { get; set; } diff --git a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs index 69a3fe436..6ddaf2d02 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs @@ -63,10 +63,10 @@ namespace Orchard.Core.Routable.Services { public IEnumerable GetSimilarSlugs(string contentType, string slug) { return - _contentManager.Query(contentType).Join() + _contentManager.Query().Join() .List() .Select(i => i.As()) - .Where(routable => routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith + .Where(routable => routable.Path != null && routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith .ToArray(); }