diff --git a/bittensor/subtensor.py b/bittensor/subtensor.py index f9b27cb93a..d9768cbeca 100644 --- a/bittensor/subtensor.py +++ b/bittensor/subtensor.py @@ -4254,8 +4254,13 @@ def get_subnets(self, block: Optional[int] = None) -> List[int]: """ result = self.query_map_subtensor("NetworksAdded", block) subnets = [] + for data in result: - subnets.append(data[0]) + continue + # Check if the 'records' attribute exists and is not None + if hasattr(result, "records") and result.records: + subnets = [subnet[0].value for subnet in result.records] + return subnets def get_all_subnets_info(self, block: Optional[int] = None) -> List[SubnetInfo]: