Great Vault bug

Gear gearId = RNG.GetRandomIdFromLootTable();

while ((listWeaponId.contains(gearId) || listShoulderId.contains(gearId)) && charName == “Perdd”)
{ gearId = RNG.GetRandomIdFromLootTable(); }

Return gearId;

Is this the bug in their code?