From d77a846c3445d3e8c6b41a39f6e2410098e18e1c Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Mon, 29 Dec 2025 20:32:21 +1000 Subject: [PATCH] [FIRE-36251] Fix crash with Omnifilter when receiving an item in OpenSim --- indra/newview/llscriptfloater.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index 4bacd49811..37b29ca453 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -496,8 +496,27 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) std::string description = notification->asLLSD()["responder_sd"]["description"].asString(); if (!description.empty()) { - LLStringUtil::getTokens(description, params, "/"); - haystack.mRegionName = LLURI::unescape(params.at(params.size() - 4)); + if (LLGridManager::instance().isInSecondLife()) + { + LLStringUtil::getTokens(description, params, "/"); + haystack.mRegionName = LLURI::unescape(params.at(params.size() - 4)); + } + else + { + // OpenSim handles notification descriptions a little differently + constexpr std::string_view location_key = "located at "; + auto location_pos_start = description.find(location_key); + auto location_pos_end = description.find(" <", location_pos_start); + if (location_pos_start != std::string_view::npos && location_pos_end != std::string_view::npos) + { + location_pos_start += location_key.size(); + haystack.mRegionName = description.substr(location_pos_start, location_pos_end - location_pos_start); + } + else + { + haystack.mRegionName.clear(); + } + } } haystack.mType = OmnifilterEngine::eType::URLRequest;