From 2e060e09bd3e202a2fbc603748ff738366d4c183 Mon Sep 17 00:00:00 2001 From: Adam Rohdin Date: Fri, 2 Jun 2023 11:49:20 +0200 Subject: [PATCH] Fixes crash when calling openspace.getProperty() with only a tag --- src/scene/scene_lua.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index cf8d768b38..96b2fb93c7 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -282,7 +282,8 @@ bool doesUriContainGroupTag(const std::string& command, std::string& groupName) } std::string removeGroupNameFromUri(const std::string& uri) { - return uri.substr(uri.find_first_of(".")); + size_t pos = uri.find_first_of("."); + return pos == std::string::npos ? uri : uri.substr(pos); } } // namespace