Fixed crash after removing last program from a robot

master
krzys-h 2015-09-01 16:10:12 +02:00
parent c3d7876a5c
commit 89c93c15cd
1 changed files with 2 additions and 2 deletions

View File

@ -1777,9 +1777,9 @@ void CObjectInterface::UpdateInterface()
type == OBJECT_CONTROLLER) // vehicle?
{
bRun = false;
if ( m_selScript < m_programStorage->GetProgramCount() )
if (m_selScript >= 0 && m_selScript < m_programStorage->GetProgramCount())
{
if(m_programStorage->GetProgram(m_selScript)->runnable)
if (m_programStorage->GetProgram(m_selScript)->runnable)
{
m_programStorage->GetProgram(m_selScript)->script->GetTitle(title);
if ( title[0] != 0 )