From ab4c94e37c7c53721ba6fa622dc61c16b68513e9 Mon Sep 17 00:00:00 2001 From: forest Date: Mon, 15 Feb 2021 20:32:24 -0600 Subject: [PATCH] correctly test for none result in double_check_capsul_address --- capsulflask/console.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/capsulflask/console.py b/capsulflask/console.py index 644c66c..9029649 100644 --- a/capsulflask/console.py +++ b/capsulflask/console.py @@ -30,10 +30,11 @@ def makeCapsulId(): def double_check_capsul_address(id, ipv4, get_ssh_host_keys): try: result = current_app.config["HUB_MODEL"].get(id, get_ssh_host_keys) - if result.ipv4 != ipv4: + if result != None and result.ipv4 != ipv4: ipv4 = result.ipv4 get_model().update_vm_ip(email=session["account"], id=id, ipv4=result.ipv4) - if get_ssh_host_keys: + + if result != None and get_ssh_host_keys: get_model().update_vm_ssh_host_keys(email=session["account"], id=id, ssh_host_keys=result.ssh_host_keys) except: current_app.logger.error(f"""