Closed ghost closed 2 years ago
Observed this issue when saving the design from MetalGUI. App did not crash on my system but there were exceptions when using 'cancel' .
QFileDialog.getSaveFileName returns empty string as filename - ( https://github.com/Qiskit/qiskit-metal/blob/main/qiskit_metal/_gui/main_window.py#L163 ) 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)
Information
What is the current behavior?
Choose
save as
but instead of saving a file, click cancel. The app will crash.Steps to reproduce the problem
Choose
save as
but instead of saving a file, click cancel. The app will crash.What is the expected behavior?
Choose
save as
but instead of saving a file, click cancel. The app should close the file-name-choosing window and not save a copy of the chipSuggested solutions