summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallery.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-10-09 23:20:41 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-10-10 11:21:05 +0300
commitd5218c05219a6bddb63d752a9df3b5d6fe1e3cf7 (patch)
treee1a7b69c31f5493f1fd2fac0854645fd456692ba /indra/newview/llinventorygallery.cpp
parenta9dfb9d918fe12851ef93110baa149e1c49d2efa (diff)
viewer#2818 Creating a link to an empty notecard fails #3
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 c4f93cee98..03bafa48bd 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2105,6 +2105,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)
{