I guess this is my code, but if you don't mind changing it, I think `if ( hud.elements.hasOwnProperty( item.owner ) )` is the same as `if ( inventory )` in this case.