From ab7dd7ed89899e2a17f70262e83437f50f2a924f Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Tue, 22 Feb 2022 01:42:24 +0530 Subject: Fixed saving empty file crash issue --- src/maker/Maker.py | 14 ++++++++++++-- 1 file 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): -- cgit