Skip to content

Commit

Permalink
Fix assert was stripped in release build with important code inside
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Jul 20, 2023
1 parent 7c73ffb commit 94f4c00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/zylann.hterrain/hterrain_data.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,10 @@ func _load_metadata(path: String):
var text = f.get_as_text()
f = null # close file
var json = JSON.new()
assert(json.parse(text) == OK)
var json_err := json.parse(text)
# Careful, `assert` is stripped in release exports, including its argument expression...
# See https://github.com/godotengine/godot-proposals/issues/502
assert(json_err == OK)
_deserialize_metadata(json.data)


Expand Down

0 comments on commit 94f4c00

Please sign in to comment.