Fixed like issue
authorMarcel Werk <burntime@woltlab.com>
Sun, 24 Nov 2013 23:33:20 +0000 (00:33 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sun, 24 Nov 2013 23:33:20 +0000 (00:33 +0100)
wcfsetup/install/files/lib/data/comment/LikeableCommentProvider.class.php
wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponseProvider.class.php

index 2d423662725462fa1bad5097800d38b0daa8e737..ed622f8dde511c6949bd15b56346d61092177e57 100644 (file)
@@ -35,6 +35,8 @@ class LikeableCommentProvider extends AbstractObjectTypeProvider implements ILik
         * @see \wcf\data\like\ILikeObjectTypeProvider::checkPermissions()
         */
        public function checkPermissions(ILikeObject $comment) {
+               if (!$comment->commentID) return false;
+               
                $objectType = CommentHandler::getInstance()->getObjectType($comment->objectTypeID);
                return CommentHandler::getInstance()->getCommentManager($objectType->objectType)->isAccessible($comment->objectID);
        }
index d230c63264367026f6569886cb23ba8a49f6ec7d..ecd780d17f846be50d4738b81da6ffc9c6a6f3b2 100644 (file)
@@ -36,6 +36,7 @@ class LikeableCommentResponseProvider extends AbstractObjectTypeProvider impleme
         * @see \wcf\data\like\ILikeObjectTypeProvider::checkPermissions()
         */
        public function checkPermissions(ILikeObject $response) {
+               if (!$response->responseID) return false;
                $comment = new Comment($response->commentID);
                if (!$comment->commentID) {
                        return false;