diff options
author | rahulp13 | 2022-02-22 01:42:24 +0530 |
---|---|---|
committer | rahulp13 | 2022-02-22 01:42:24 +0530 |
commit | ab7dd7ed89899e2a17f70262e83437f50f2a924f (patch) | |
tree | 877c274a597ecbc89d9b89856423d8be6051ddb8 | |
parent | 2b0b878d72c74e3a335b346362eaa533c5459821 (diff) | |
download | eSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.tar.gz eSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.tar.bz2 eSim-ab7dd7ed89899e2a17f70262e83437f50f2a924f.zip |
Fixed saving empty file crash issue
-rwxr-xr-x | src/maker/Maker.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/maker/Maker.py b/src/maker/Maker.py index f3f8b93e..6d97e4d3 100755 --- a/src/maker/Maker.py +++ b/src/maker/Maker.py @@ -194,8 +194,18 @@ class Maker(QtWidgets.QWidget): # This function is used to save the edited file in eSim def save(self): - wr = self.entry_var[1].toPlainText() - open(self.verilogfile, "w+").write(wr) + try: + wr = self.entry_var[1].toPlainText() + open(self.verilogfile, "w+").write(wr) + except BaseException as err: + self.msg = QtWidgets.QErrorMessage(self) + self.msg.setModal(True) + self.msg.setWindowTitle("Error Message") + self.msg.showMessage( + "Error in saving verilog file. Please check if it is chosen." + ) + self.msg.exec_() + print("Error in saving verilog file: " + str(err)) # This is used to run the makerchip-app def runmakerchip(self): |