Skip to content

Commit 5b1fdf9

Browse files
committed
Fix not being able to view storage unit contents if they contain items with missing properties
1 parent 1c3a2c2 commit 5b1fdf9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cs2/items/inventory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class Inventory {
5959
for (const item of [...this.items, ...this.storedItems]) {
6060
item.id = item.iteminfo.id;
6161
item.name = !!item.wear_name && item.full_name.includes(item.wear_name) ? item.full_name.slice(0, -(item.wear_name.length + 3)) : item.full_name;
62-
item.name_normalized = item.name.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
62+
item.name_normalized = !item.name ? undefined : item.name.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
6363
item.collection_name = item.set_name ?? item.crate_name?.replace(/( Autograph Capsule)$/, " Autographs").replace(/( Capsule)$/, "");
6464
item.collection = item.collection_name?.replace(/^(The )/, "").replace(/( Collection)$/, "").replace(/^(Operation )/, "").replace(/( Autographs)$/, "");
6565
item.rarity = item.collection || item.iteminfo.rarity > 1 ? item.iteminfo.rarity : undefined; // leave rarity undefined for crates and such items for sorting purposes

0 commit comments

Comments
 (0)