From c4c5f62b0499f6b648cc5c9cf63aa57063e1741c Mon Sep 17 00:00:00 2001 From: akl Date: Tue, 23 Sep 2014 15:22:10 +0400 Subject: [PATCH] Avoid using of empty list. --- src/PyConsole/PyConsole_Editor.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx index c9542464a..05eaa6ba0 100644 --- a/src/PyConsole/PyConsole_Editor.cxx +++ b/src/PyConsole/PyConsole_Editor.cxx @@ -943,7 +943,8 @@ void PyConsole_Editor::customEvent( QEvent* event ) { PrintEvent* pe=(PrintEvent*)event; addText( pe->text(), false, pe->isError()); - myHistory.last().output = myHistory.last().output + pe->text(); + if ( myHistory.count() > 0 ) + myHistory.last().output = myHistory.last().output + pe->text(); return; } case PyInterp_Event::ES_OK: -- 2.39.2