Possible Duplicate: Detecting an undefined object property in JavaScript javascript undefined compare
H
I am not sure it is the best solution, but it works fine:
if($someObject['length']!=0){ //do someting }