add check if state name is empty in rsi validator (#6145)

* add check if state name exists

* Apply suggestions from code review

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
leonidussaks
2025-08-20 19:49:45 +03:00
committed by GitHub
parent 856cdb8a3d
commit 41b2ee19a1

View File

@@ -135,6 +135,13 @@ def check_rsi(rsi: str, schema: Draft7Validator):
add_error(rsi, f"{state_name}: sprite sheet of {size[0]}x{size[1]} is too small, metadata defines {frame_count} frames, but it can only fit {max_sheet_frames} at most")
continue
# Check if state name exists
for state in meta_json["states"]:
state_name: str = state["name"]
if state_name == "":
add_error(rsi, f"state name cannot be an empty string.")
return
# We're good!
return