diff --git a/src/Python/qsharp-core/qsharp/loader.py b/src/Python/qsharp-core/qsharp/loader.py index 452c17da..d4a61325 100644 --- a/src/Python/qsharp-core/qsharp/loader.py +++ b/src/Python/qsharp-core/qsharp/loader.py @@ -144,7 +144,7 @@ class QSharpCallable(object): """ data = qsharp.client.compile_to_qir(self, **kwargs) - if "Text" in data: + if data and ("Text" in data): return data['Text'] raise IQSharpError([f'Error in generating QIR. {data}'])