我是 php 新手。
尝试解析一个 stdClass 对象:
        $datastoresArray = $geoserver->listDataStores($item->name);
        foreach ($datastoresArray as $dstores){
            if($dstores->dataStore != null){
                $dstore = $dstores->dataStore;
                foreach ($dstore as $item){
                    echo "  - ".$item->name."\n";
                }
            }
        }
在这一行if($dstores->dataStore != null){我得到错误Traing to get property of non-object。因为有些时候我没有dataStore。$dstores如何知道我有什么dataStore和没有什么?