summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-07-22 18:54:09 +0300
committerGitHub <noreply@github.com>2024-07-22 18:54:09 +0300
commitdc2aab4ee42e4e7ecf14d475b803446fee422cbb (patch)
treee69eb8ce7fb2857ba24c348b7b738fd962591e4b
parent75fb5c0d5e54c36327cfdca17e6ccc1682743fe0 (diff)
parent15877bf396f1b37784a8449540335960190862d0 (diff)
Merge pull request #2085 from RyeMutt/crash-fixes
Fix various nullptr crashes
-rw-r--r--indra/llui/llscrolllistctrl.cpp6
-rw-r--r--indra/newview/llfloaterimcontainer.cpp11
-rw-r--r--indra/newview/llimview.cpp18
-rw-r--r--indra/newview/llinventorybridge.cpp2
-rw-r--r--indra/newview/llinventorypanel.cpp2
-rw-r--r--indra/newview/llpanellandmarks.cpp16
-rw-r--r--indra/newview/llviewercontrol.cpp13
-rw-r--r--indra/newview/llviewerwindow.cpp2
-rw-r--r--indra/newview/llxmlrpctransaction.cpp2
9 files changed, 48 insertions, 24 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 74a9641836..1d9564d107 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -1479,7 +1479,11 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const
item = getFirstSelected();
if (item)
{
- return item->getColumn(column)->getValue().asString();
+ auto col = item->getColumn(column);
+ if(col)
+ {
+ return col->getValue().asString();
+ }
}
return LLStringUtil::null;
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index add389748f..08e13276b3 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -988,11 +988,14 @@ void LLFloaterIMContainer::onAddButtonClicked()
{
LLView * button = findChild<LLView>("conversations_pane_buttons_expanded")->findChild<LLButton>("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this);
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
-
- if (picker && root_floater)
+ if (button && root_floater)
{
- root_floater->addDependentFloater(picker);
+ LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
+
+ if (picker)
+ {
+ root_floater->addDependentFloater(picker);
+ }
}
}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index b12c2fdc52..33e6d2d1b2 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -3042,13 +3042,16 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
gIMMgr->addSession(correct_session_name, type, session_id, payload["voice_channel_info"]);
- std::string url = gAgent.getRegion()->getCapability(
+ std::string url = gAgent.getRegionCapability(
"ChatSessionRequest");
if (voice)
{
- LLCoros::instance().launch("chatterBoxInvitationCoro",
- boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"]));
+ if(!url.empty())
+ {
+ LLCoros::instance().launch("chatterBoxInvitationCoro",
+ boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"]));
+ }
// send notification message to the corresponding chat
if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc")
@@ -4063,9 +4066,12 @@ public:
// Send request for chat history, if enabled.
if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
{
- std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
- LLCoros::instance().launch("chatterBoxHistoryCoro",
- boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
+ std::string url = gAgent.getRegionCapability("ChatSessionRequest");
+ if (!url.empty())
+ {
+ LLCoros::instance().launch("chatterBoxHistoryCoro",
+ boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
+ }
}
}
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index e40ab86010..8f3dc3ce16 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -961,7 +961,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
}
- if (obj->getType() != LLAssetType::AT_CATEGORY)
+ if (obj && obj->getType() != LLAssetType::AT_CATEGORY)
{
items.push_back(std::string("Paste Separator"));
}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 6c58eb2ca4..1a6e25fb0f 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -643,7 +643,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
}
// Select any newly created object that has the auto rename at top of folder root set.
- if(mFolderRoot.get()->getRoot()->needsAutoRename())
+ if(mFolderRoot.get() && mFolderRoot.get()->getRoot()->needsAutoRename())
{
setSelection(item_id, false);
}
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 99133d1fb3..fb7ccbfe4c 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -647,10 +647,18 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
if ("collapse_all" == command_name)
{
+ if (!mCurrentSelectedList)
+ {
+ return false;
+ }
return has_expanded_folders(mCurrentSelectedList->getRootFolder());
}
else if ("expand_all" == command_name)
{
+ if (!mCurrentSelectedList)
+ {
+ return false;
+ }
return has_collapsed_folders(mCurrentSelectedList->getRootFolder());
}
else if ("sort_by_date" == command_name)
@@ -959,12 +967,12 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
// then ask LLFolderView permissions
- LLFolderView* root_folder = mCurrentSelectedList->getRootFolder();
+ LLFolderView* root_folder = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr;
if ("copy" == command_name)
{
// we shouldn't be able to copy folders from My Inventory Panel
- return can_be_modified && root_folder->canCopy();
+ return can_be_modified && root_folder && root_folder->canCopy();
}
else if ("collapse" == command_name)
{
@@ -981,7 +989,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
if ("cut" == command_name)
{
- can_be_modified = root_folder->canCut();
+ can_be_modified = root_folder && root_folder->canCut();
}
else if ("rename" == command_name)
{
@@ -993,7 +1001,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
}
else if("paste" == command_name)
{
- can_be_modified = root_folder->canPaste();
+ can_be_modified = root_folder && root_folder->canPaste();
}
else
{
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 1d483f1b8a..0e1f4c09c7 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -263,12 +263,15 @@ static bool handleAnisotropicChanged(const LLSD& newvalue)
static bool handleVSyncChanged(const LLSD& newvalue)
{
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
- gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
-
- if (newvalue.asBoolean())
+ if (gViewerWindow && gViewerWindow->getWindow())
{
- U32 current_target = gSavedSettings.getU32("TargetFPS");
- gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
+
+ if (newvalue.asBoolean())
+ {
+ U32 current_target = gSavedSettings.getU32("TargetFPS");
+ gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
+ }
}
return true;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 2869c53992..9dc12c4856 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1271,7 +1271,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
LLTextureEntry *te = obj->getTE(object_face);
// can modify URL if we can modify the object or we have navigate permissions
- bool allow_modify_url = obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT );
+ bool allow_modify_url = obj->permModify() || (te && obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ));
if (te && allow_modify_url )
{
diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp
index ba48b58f3b..48461241a2 100644
--- a/indra/newview/llxmlrpctransaction.cpp
+++ b/indra/newview/llxmlrpctransaction.cpp
@@ -316,7 +316,7 @@ bool LLXMLRPCTransaction::Impl::process()
if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(),
root, nullptr))
{
- LL_WARNS() << "Failed parsing XML in response; request URI: "
+ LL_WARNS() << "Failed parsing XML in response; request URI: "
<< mURI << LL_ENDL;
}
else if (parseResponse(root))