Fixed handling of slide with no layers.

This commit is contained in:
Robert Osfield
2011-10-24 11:09:35 +00:00
parent e04ca06fc8
commit 1538ecf113

View File

@@ -1188,7 +1188,7 @@ bool SlideEventHandler::previousSlide()
bool SlideEventHandler::nextLayer()
{
LayerAttributes* la = (_slideSwitch.valid() && _activeLayer>=0) ? dynamic_cast<LayerAttributes*>(_slideSwitch->getChild(_activeLayer)->getUserData()) : 0;
LayerAttributes* la = (_slideSwitch.valid() && _activeLayer<static_cast<int>(_slideSwitch->getNumChildren())) ? dynamic_cast<LayerAttributes*>(_slideSwitch->getChild(_activeLayer)->getUserData()) : 0;
if (la)
{
la->callLeaveCallbacks(_slideSwitch->getChild(_activeLayer));