summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-10-13 16:19:33 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-10-13 18:17:05 +0300
commit449f64caa2e1f62ab24e02465faadd0f02ac3023 (patch)
treef4e3fcdd308eb8e32ff247cb0b323b181d6a1a7f /indra/newview/llinventorygallery.cpp
parent38257221d090a8c2669d34a23891e7b66153df6f (diff)
#2818 Creating a link to an empty notecard fails
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r--indra/newview/llinventorygallery.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index a4cb6ea65d..c54af7d9f1 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2120,6 +2120,30 @@ void LLInventoryGallery::pasteAsLink()
std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
+ if (objects.size() == 0)
+ {
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+
+ LLUUID& first_id = objects[0];
+ LLInventoryItem* item = gInventory.getItem(first_id);
+ if (item && item->getAssetUUID().isNull())
+ {
+ if (item->getActualType() == LLAssetType::AT_NOTECARD)
+ {
+ LLNotificationsUtil::add("CantLinkNotecard");
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+ else if (item->getActualType() == LLAssetType::AT_MATERIAL)
+ {
+ LLNotificationsUtil::add("CantLinkMaterial");
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+ }
+
bool paste_into_root = mSelectedItemIDs.empty();
for (LLUUID& dest : mSelectedItemIDs)
{