Remove asserts the types already cover

The nil check burn down added guards which turned out redundant once
the surrounding annotations landed. `_has_handlers` is set to true when
the first handler registers, so it is a boolean rather than the literal
false it was inferred as.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:48 +00:00
co-authored by Claude Opus 5
parent f907007d14
commit 619ed4b39f
19 changed files with 68 additions and 55 deletions
+4 -4
View File
@@ -294,10 +294,10 @@ local confirm_edit_button = Gui.define("confirm_edit_button")
local parent = assert(element.parent)
local grandparent = assert(parent.parent)
local warp_id = parent.caption --[[@as string]]
local name_flow = assert(grandparent["name-" .. warp_id])
local icon_flow = assert(grandparent["icon-" .. warp_id])
local warp_name = assert(name_flow[warp_textfield.name]).text
local warp_icon = assert(icon_flow[warp_icon_editing.name]).elem_value --[[@as SignalID]]
local name_flow = grandparent["name-" .. warp_id]
local icon_flow = grandparent["icon-" .. warp_id]
local warp_name = name_flow[warp_textfield.name].text
local warp_icon = icon_flow[warp_icon_editing.name].elem_value --[[@as SignalID]]
if warp_icon.type == nil then warp_icon.type = "item" end
Warps.set_editing(warp_id, player.name)
Warps.update_warp(warp_id, warp_name, warp_icon, player.name)