Invalid argument in foreach

Create issue
Issue #22 resolved
Former user created an issue

Hi, i enabled the comments compoent in a partial and after first comment got published i got an exception "Invalid argument supplied for foreach()"

{% component 'comments' %}

it seems like if there are no comments then it crashes

Comments (2)

  1. VItalij

    So now i fixed the Problem. in the method loadComments in the line

    if (!$comments->count()) return ;

    i made return []; so the loadCOmments return an empty array and foreach does not break, can you add this to the sourcecode please?

  2. Log in to comment