1
0
forked from 0ad/0ad

Get rid of errors (selection can have size 0).

This was SVN commit r3061.
This commit is contained in:
prefect 2005-10-30 21:09:27 +00:00
parent 695d966788
commit 416c7fe4ba

View File

@ -211,7 +211,7 @@ function resetUpdateVars()
propertyWatches[watchedObject].unwatchAll( selectionWatchHandler ); // Remove the handler
propertyWatches = new Array();
if( selection[0] )
if( selection.length > 0 && selection[0] )
{
// Watch the object itself
selection[0].watchAll( selectionWatchHandler );
@ -228,7 +228,7 @@ function resetUpdateVars()
}
}
selectionChanged = false;
if( selection[0] )
if( selection.length > 0 && selection[0] )
{
selectionTemplate = selection[0].template;
}