Skip to content

Commit

Permalink
Merge pull request #43 from HotariTobu:fix/HotariTobu-assert-in-bind-…
Browse files Browse the repository at this point in the history
…type-check

To error in bind type check if the specified property is not in the source object
  • Loading branch information
HotariTobu authored Nov 21, 2024
2 parents c625006 + 8a7501d commit 08b733f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/gd_data_binding/scripts/binding_source.gd
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ class Binder:
to_text_edit(code_edit, trigger)

func _convert_to(target_type: Variant.Type):
var source_value = _source.get(_source_property)
assert(
_source_property in _source,
"The source property %s was not in the source object." % _source_property
)
var source_value = _source[_source_property]
var target_value = _converter_pipeline.source_to_target(source_value)
return typeof(target_value) == target_type

Expand Down

0 comments on commit 08b733f

Please sign in to comment.