From 9bb95efaaafa1edc7c4c6502b7dd4d77a509fe18 Mon Sep 17 00:00:00 2001 From: myates Date: Mon, 21 Sep 2015 10:18:49 +1000 Subject: [PATCH] #5836 Fix null ref exception in CommentPartDriver --- .../Modules/Orchard.Comments/Drivers/CommentPartDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentPartDriver.cs index 676536253..1d8aaed52 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Comments/Drivers/CommentPartDriver.cs @@ -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(); - if (!commentsPart.CommentsActive) { + if (commentsPart == null || !commentsPart.CommentsActive) { _orchardServices.TransactionManager.Cancel(); return Editor(part, shapeHelper); }