Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
shobhit seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it.
What are the issues this pull addresses (issue numbers / links)?
Issue #669 https://github.com/Qiskit/qiskit-metal/issues/669
Did you add tests to cover your changes (yes/no)?
no
Did you update the documentation accordingly (yes/no)?
yes
Did you read the CONTRIBUTING document (yes/no)?
yes
Summary
Fixed the issue #669 by updating save_design function in qiskit_metal/_gui/main_window.py
Details and comments
When using cancel instead of save, QFileDialog.getSaveFileName returns empty string( https://github.com/Qiskit/qiskit-metal/blob/main/qiskit_metal/_gui/main_window.py#L163 ) as filename. This caused a FileNotFoundError during opening of file (https://github.com/Qiskit/qiskit-metal/blob/main/qiskit_metal/_gui/main_window.py#L171).
To fix the issue , an empty check was added. File will be opened and written to only if filename is non-empty (length of string is non-zero)