Merge pull request #5837 from mjy78/issue/5836

#5836 Fix null ref exception in CommentPartDriver
This commit is contained in:
Sébastien Ros
2015-09-21 12:58:01 -07:00

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);
}