diff --git a/avogadro/qtplugins/scriptcharges/chargeScripts/antechamber.py b/avogadro/qtplugins/scriptcharges/chargeScripts/antechamber.py index 0d4fe1e26c..4e3b3fda61 100644 --- a/avogadro/qtplugins/scriptcharges/chargeScripts/antechamber.py +++ b/avogadro/qtplugins/scriptcharges/chargeScripts/antechamber.py @@ -144,7 +144,11 @@ def potential(): if args["metadata"]: print(json.dumps(getMetaData())) elif args["display_name"]: - print(getMetaData()["name"]) + name = getMetaData().get("name") + if name: + print(name) + else: + raise RuntimeError("antechamber is unavailable") elif args["charges"]: print(charges()) elif args["potential"]: diff --git a/avogadro/qtplugins/scriptcharges/chargeScripts/xtb.py b/avogadro/qtplugins/scriptcharges/chargeScripts/xtb.py index ecd6e659c2..193b58b40e 100644 --- a/avogadro/qtplugins/scriptcharges/chargeScripts/xtb.py +++ b/avogadro/qtplugins/scriptcharges/chargeScripts/xtb.py @@ -93,7 +93,11 @@ def potential(): if args["metadata"]: print(json.dumps(getMetaData())) elif args["display_name"]: - print(getMetaData()["name"]) + name = getMetaData().get("name") + if name: + print(name) + else: + raise RuntimeError("xtb is unavailable") elif args["charges"]: print(charges()) elif args["potential"]: