PHP simple html dom, trying to get property of non-object
===

I get the next notice when firing a specific function:

    Trying to get property of non-object in...

My function:

    private function rate($form)
    {
    	$score = 0;
    
    	$count = $form->find('input')->length;
    	$score += ($count >= 2 && $count <= 5) ? INPUT_COUNT_RATE : 0;
    
    	$count = $form->find('textarea')->length;
    	$score += $count == 1 ? TEXTAREA_COUNT_RATE : 0;
    
    	return $score;
    }

The problematic lines are the lines with the `find` function.

A `var_dump` of `$form` returns:

    object(simple_html_dom_node)[1062]...

What could be the problem?