Corrected none null asumptions when altering exiting Content Types with new Parts

--HG--
branch : dev
This commit is contained in:
Sebastien Ros 2010-07-19 11:50:13 -07:00
parent 9301e9eb0a
commit 3bf8517cb2
2 changed files with 3 additions and 3 deletions

View File

@ -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<CommonAspect>().VersionPublishedUtc; } }
public DateTime? VersionPublishedUtc { get { return ContentItem.As<CommonAspect>() == null ? null : ContentItem.As<CommonAspect>().VersionPublishedUtc; } }
public DateTime? ScheduledPublishUtc { get; set; }

View File

@ -63,10 +63,10 @@ namespace Orchard.Core.Routable.Services {
public IEnumerable<IsRoutable> GetSimilarSlugs(string contentType, string slug)
{
return
_contentManager.Query(contentType).Join<RoutableRecord>()
_contentManager.Query().Join<RoutableRecord>()
.List()
.Select(i => i.As<IsRoutable>())
.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();
}