I am trying to debug an issue with llGetInventoryName. Here is my function from my code
deleteOldObjects()
{
integer objectTotal = llGetInventoryNumber(INVENTORY_OBJECT);
integer i;
for (i = 0; i < objectTotal; i++) {
string name = llGetInventoryName(INVENTORY_OBJECT, i);
llRemoveInventory(name);
}
}
For some reason, while the code will provide the names for the other objects in the hosting object's inventory, it will never provide the name for another specific object; no matter what I do. I can make a copy of the same object that reports its name, rename it and then the copy will not report back its new name. I can make a copy of an object that reported its name correctly and rename that but then it stops reporting. (The name is "Hemp Joint" - not a reserved or key word!

Putting llSay statements in the code prove that it can see the correct number of objects in the hosting object's inventory yet, while providing correct names for the other objects, it will always return a blank name for a certain object (thereby preventing it from being deleted).
I am going crazy trying to correct this - thanks for any help!