From: akl Date: Tue, 23 Sep 2014 11:22:10 +0000 (+0400) Subject: Avoid using of empty list. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c4c5f62b0499f6b648cc5c9cf63aa57063e1741c;p=modules%2Fgui.git Avoid using of empty list. --- 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: