Skip to content

Commit

Permalink
Address warning
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed Oct 17, 2023
1 parent a92e9b7 commit 7ae1fb1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/SwiftGodot/Core/Wrapped.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ open class Wrapped: Equatable, Identifiable, Hashable {
fatalError("This constructor should not be called")
}

/// Returns the Godot's class name as a `StringName`
/// Returns the Godot's class name as a `StringName`, returns the empty string on error
public var godotClassName: StringName {
var sc: StringName.ContentType = StringName.zero

gi.object_get_class_name (handle, library, &sc)
let sn = StringName(content: sc)
return sn
if gi.object_get_class_name (handle, library, &sc) != 0 {
let sn = StringName(content: sc)
return sn
}
return ""
}

/// The constructor chain that uses StringName is internal, and is triggered
Expand Down

0 comments on commit 7ae1fb1

Please sign in to comment.