Do not log error when casting fails
This allows not to perform unnecessary 'of' check before casting, if cast failure is expected.
This commit is contained in:
parent
1b8e7ccd98
commit
78d3626fa3
2 changed files with 1 additions and 4 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
version = "0.7.24"
|
version = "0.7.25"
|
||||||
author = "Xored Software, Inc."
|
author = "Xored Software, Inc."
|
||||||
description = "Godot Engine bindings"
|
description = "Godot Engine bindings"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
||||||
|
|
@ -332,9 +332,6 @@ proc `as`*[T: NimGodotObject](obj: NimGodotObject, t: typedesc[T]): T =
|
||||||
elif not obj.linkedObject.isNil and system.`of`(obj.linkedObject, T):
|
elif not obj.linkedObject.isNil and system.`of`(obj.linkedObject, T):
|
||||||
result = T(obj.linkedObject)
|
result = T(obj.linkedObject)
|
||||||
else:
|
else:
|
||||||
when not defined(release):
|
|
||||||
printError("Failed to cast object to " &
|
|
||||||
T.name & "\n" & getStackTrace())
|
|
||||||
result = nil
|
result = nil
|
||||||
|
|
||||||
proc `of`*[T1, T2: NimGodotObject](obj: T1, t: typedesc[T2]): bool {.inline.} =
|
proc `of`*[T1, T2: NimGodotObject](obj: T1, t: typedesc[T2]): bool {.inline.} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue