chore(webui): handle malformed rivens so they can be deleted at least
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build / build (pull_request) Successful in 56s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build / build (pull_request) Successful in 56s
				
			This commit is contained in:
		
							parent
							
								
									f796f9a851
								
							
						
					
					
						commit
						4274997c1c
					
				@ -1017,13 +1017,19 @@ function updateInventory() {
 | 
				
			|||||||
                if (item.ItemType.substr(0, 32) == "/Lotus/Upgrades/Mods/Randomized/") {
 | 
					                if (item.ItemType.substr(0, 32) == "/Lotus/Upgrades/Mods/Randomized/") {
 | 
				
			||||||
                    const rivenType = item.ItemType.substr(32);
 | 
					                    const rivenType = item.ItemType.substr(32);
 | 
				
			||||||
                    const fingerprint = JSON.parse(item.UpgradeFingerprint);
 | 
					                    const fingerprint = JSON.parse(item.UpgradeFingerprint);
 | 
				
			||||||
                    if (fingerprint.buffs) {
 | 
					                    if ("buffs" in fingerprint) {
 | 
				
			||||||
                        // Riven has been revealed?
 | 
					                        // Riven has been revealed?
 | 
				
			||||||
                        const tr = document.createElement("tr");
 | 
					                        const tr = document.createElement("tr");
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            const td = document.createElement("td");
 | 
					                            const td = document.createElement("td");
 | 
				
			||||||
                            td.textContent = itemMap[fingerprint.compat]?.name ?? fingerprint.compat;
 | 
					                            td.textContent = itemMap[fingerprint.compat]?.name ?? fingerprint.compat;
 | 
				
			||||||
                            td.textContent += " " + RivenParser.parseRiven(rivenType, fingerprint, 1).name;
 | 
					                            td.textContent += " ";
 | 
				
			||||||
 | 
					                            try {
 | 
				
			||||||
 | 
					                                td.textContent += RivenParser.parseRiven(rivenType, fingerprint, 1).name;
 | 
				
			||||||
 | 
					                            } catch (e) {
 | 
				
			||||||
 | 
					                                console.warn("malformed riven", { rivenType, fingerprint });
 | 
				
			||||||
 | 
					                                td.textContent += " [Malformed Riven]";
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
                            td.innerHTML +=
 | 
					                            td.innerHTML +=
 | 
				
			||||||
                                " <span title='" +
 | 
					                                " <span title='" +
 | 
				
			||||||
                                loc("code_buffsNumber") +
 | 
					                                loc("code_buffsNumber") +
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user