diff --git a/source/java/org/alfresco/repo/web/scripts/comments/AbstractCommentsWebScript.java b/source/java/org/alfresco/repo/web/scripts/comments/AbstractCommentsWebScript.java index 080fb9497f..dd59553c6d 100644 --- a/source/java/org/alfresco/repo/web/scripts/comments/AbstractCommentsWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/comments/AbstractCommentsWebScript.java @@ -234,14 +234,14 @@ public abstract class AbstractCommentsWebScript extends DeclarativeWebScript SiteInfo siteInfo = getSiteInfo(req, COMMENT_CREATED_ACTIVITY.equals(activityType)); - // post an activity item, but only if we've got a site - if (siteInfo != null) - { - siteId = siteInfo.getShortName(); - if (siteId == null || siteId.length() == 0) - { - return; - } + // post an activity item, but only if we've got a site + if (siteInfo == null || siteInfo.getShortName() == null || siteInfo.getShortName().length() == 0) + { + return; + } + else + { + siteId = siteInfo.getShortName(); } // json is not sent null with this activity type - only for delete