XF 2.1 Getting error while creating a new thread with "Poll"

sajal

Active member
I'm getting this error when I try to create a new thread with Poll as anonymous user in "development" mode.


I think, the following:

PHP:
if (isset($content->User) && $content->User->user_id != \XF::visitor()->user_id)

should be:

PHP:
if (isset($content->User->user_id) && $content->User->user_id != \XF::visitor()->user_id)

Experts?
 
This looks like a bug, I'd report it. It should be checking !empty($content->User) or simply if $content->User is truthy, as isset($content->User) will be true even when there is no user.
 
Back
Top Bottom