mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-01 09:08:49 -06:00
Fix fatal error when starting profile with navigation state camera setting
And provide more information in the fatal error message... (emerged from commit 30b80843c3)
This commit is contained in:
@@ -1720,7 +1720,9 @@ void setCameraFromProfile(const Profile& p) {
|
||||
|
||||
auto checkNodeExists = [](const std::string& node) {
|
||||
if (global::renderEngine->scene()->sceneGraphNode(node) == nullptr) {
|
||||
throw ghoul::RuntimeError(fmt::format("Could not find node '{}'", node));
|
||||
throw ghoul::RuntimeError(fmt::format(
|
||||
"Error when setting camera from profile. Could not find node '{}'", node
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1730,7 +1732,7 @@ void setCameraFromProfile(const Profile& p) {
|
||||
interaction::NavigationState nav;
|
||||
nav.anchor = navStateProfile.anchor;
|
||||
checkNodeExists(nav.anchor);
|
||||
if (navStateProfile.aim.has_value()) {
|
||||
if (navStateProfile.aim.has_value() && !(*navStateProfile.aim).empty()) {
|
||||
nav.aim = navStateProfile.aim.value();
|
||||
checkNodeExists(nav.aim);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user