title: Call to a member function children() on a non-object but i need to continue execution
body: <p>that i need is;
  Fatal error: Call to a member function children() on a non-object
  i know the cause of this but i need to continue executing and i can't
  My problem is that i want to take eight images from my page and im doing this;</p>
  
  <pre><code>do {
          if(is_Object($html2-&gt;find("#ficha_fotos",0)-&gt;children($j)) === true){
              if($html2-&gt;find("#ficha_fotos",0)-&gt;children($j)-&gt;children(0)-&gt;src){
                  $imggran = $html2-&gt;find("#ficha_fotos",0)-&gt;children($j)-&gt;children(0)-&gt;src."&lt;br /&gt;";
                  $imggran = explode(".", $imggran);
                  $imggran[2] = $imggran[2]."G";
                  $salidaimg = implode('.',$imggran);
                  echo $salidaimg;
              }
              $j++;
          }else {
              $j++;
          }
      } while($j &lt; 50);
  </code></pre>
  
  <p>but in some pages i got less than eight so i need to avoid this error and continue executing.
  thanks and sorry for the inconvenience</p>