Skip to content

Commit

Permalink
Ignore unset hub/group/project field on backend (qiskit-community#1453)
Browse files Browse the repository at this point in the history
In some cases, backends can be created without the `_instance` field set
(so it is `None`). In this case, it is better to ignore the field than
to raise an uncaught exception.
  • Loading branch information
wshanks authored May 14, 2024
1 parent 0ddfc91 commit fe4ccff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit_experiments/framework/experiment_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def _set_backend(self, new_backend: Backend, recursive: bool = True) -> None:
if provider is not None:
self._set_hgp_from_provider(provider)
# qiskit-ibm-runtime style
elif hasattr(self._backend, "_instance"):
elif hasattr(self._backend, "_instance") and self._backend._instance:
self.hgp = self._backend._instance
if recursive:
for data in self.child_data():
Expand Down

0 comments on commit fe4ccff

Please sign in to comment.