Do not call camera move when the new camera is invalid.

This commit is contained in:
Viktor Kovacs 2021-04-20 15:17:05 +02:00
parent ddec4bd898
commit 615bab3c4d

View File

@ -155,7 +155,9 @@ OV.Viewer = class
let fov = this.camera.fov;
if (animation) {
let newCamera = this.navigation.GetFitToSphereCamera (center, radius, fov);
this.navigation.MoveCamera (newCamera, this.settings.animationSteps);
if (newCamera !== null) {
this.navigation.MoveCamera (newCamera, this.settings.animationSteps);
}
} else {
this.navigation.FitToSphere (center, radius, fov);
}