@ -226,8 +226,11 @@ plVirtualCam1::~plVirtualCam1()
// for saving camera stack
plCameraModifier1* plVirtualCam1::GetCameraNumber(size_t camNumber)
{
return (fCameraStack[camNumber]);
if (fCameraStack.size() > camNumber)
return fCameraStack[camNumber];
else
return nil;
}
// for rebuilding camera stack
void plVirtualCam1::RebuildStack(const plKey& key)
@ -2462,7 +2462,7 @@ int cyMisc::GetNumCameras()
const char* cyMisc::GetCameraNumber(int number)
plCameraModifier1* pCam = plVirtualCam1::Instance()->GetCameraNumber(number-1);
if (pCam->GetTarget())
if (pCam && pCam->GetTarget())
const char* ret = pCam->GetTarget()->GetKeyName().c_str();
plString str = plString::Format("saving camera named %s to chronicle\n",ret);