From 9cc0be6835f290ca086286c7ff330565f7bacf12 Mon Sep 17 00:00:00 2001 From: Kahtaf Alam Date: Fri, 1 Nov 2024 17:18:59 -0400 Subject: [PATCH] fix: check if file is None before unpacking --- pyproject.toml | 2 +- vana/__init__.py | 2 +- vana/client.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2f48a1f..0b7dbc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "vana" -version = "0.21.0" +version = "0.22.0" description = "" authors = ["Tim Nunamaker ", "Volodymyr Isai ", "Kahtaf Alam "] readme = "README.md" diff --git a/vana/__init__.py b/vana/__init__.py index d977765..9c9bb13 100644 --- a/vana/__init__.py +++ b/vana/__init__.py @@ -15,7 +15,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -__version__ = "0.21.0" +__version__ = "0.22.0" import rich diff --git a/vana/client.py b/vana/client.py index 1e1cf37..31aaef6 100644 --- a/vana/client.py +++ b/vana/client.py @@ -56,6 +56,8 @@ def get_file(self, file_id: int): """ get_file_fn = self.data_registry_contract.functions.files(file_id) file = self.chain_manager.read_contract_fn(get_file_fn) + if file is None: + return None (id, ownerAddress, url, addedAtBlock) = file if ownerAddress == "0x0000000000000000000000000000000000000000": return None