# HG changeset patch # User Edouard Tisserant # Date 1623405367 -7200 # Node ID 8d1cc99a8f545224eb8a22fa9985a0680120cc7f # Parent b1bc6099d4e50fa04c3be371cd607dc0b6a70b33 IDE: Log: Prevent crash when display progress on empty log. diff -r b1bc6099d4e5 -r 8d1cc99a8f54 BeremizIDE.py --- a/BeremizIDE.py Thu Jun 10 09:40:05 2021 +0200 +++ b/BeremizIDE.py Fri Jun 11 11:56:07 2021 +0200 @@ -223,7 +223,7 @@ return False def progress(self, text): - l = self.output.GetLineCount()-2 + l = max(self.output.GetLineCount()-2, 0) self.output.AnnotationSetText(l, text) self.output.AnnotationSetVisible(wx.stc.STC_ANNOTATION_BOXED) self.output.AnnotationSetStyle(l, self.black_white) @@ -496,6 +496,7 @@ self.local_runtime_tmpdir = tempfile.mkdtemp() # choose an arbitrary random port for runtime self.runtime_port = int(random.random() * 1000) + 61131 + self.Log.write(_("Starting local runtime...\n")) # launch local runtime self.local_runtime = ProcessLogger( self.Log,