fix: hardening AudioManager null stream + InventoryUI defensive get_node_or_null
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -204,8 +204,10 @@ func _update_slot_visual(panel: PanelContainer, slot_index: int) -> void:
|
||||
panel.scale = Vector2(1.0, 1.0)
|
||||
|
||||
var slot_data: Variant = inventory.slots[slot_index]
|
||||
var color_rect: ColorRect = panel.get_node("VBoxContainer/ColorRect")
|
||||
var count_label: Label = panel.get_node("VBoxContainer/CountLabel")
|
||||
var color_rect: ColorRect = panel.get_node_or_null("VBoxContainer/ColorRect")
|
||||
var count_label: Label = panel.get_node_or_null("VBoxContainer/CountLabel")
|
||||
if color_rect == null or count_label == null:
|
||||
return
|
||||
|
||||
if slot_data == null:
|
||||
color_rect.color = Color(0, 0, 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user