#5836 Fix null ref exception in CommentPartDriver

This commit is contained in:
myates
2015-09-21 10:18:49 +10:00
parent 4214329a1f
commit 9bb95efaaa

View File

@@ -119,7 +119,7 @@ namespace Orchard.Comments.Drivers {
// prevent users from commenting on a closed thread by hijacking the commentedOn property
var commentsPart = commentedOn.As<CommentsPart>();
if (!commentsPart.CommentsActive) {
if (commentsPart == null || !commentsPart.CommentsActive) {
_orchardServices.TransactionManager.Cancel();
return Editor(part, shapeHelper);
}