Skip to content

Commit

Permalink
Do not attempt to call the variant object initialize with a nil, inst…
Browse files Browse the repository at this point in the history
…ead create an explicit variant nil
  • Loading branch information
migueldeicaza committed Jun 8, 2023
1 parent 4cb39d6 commit a1ea286
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftGodot/Variant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public class Variant: Hashable, Equatable, ExpressibleByStringLiteral {

public init (_ value: Object?) {
guard let value else {
Variant.fromTypeMap [GType.object.rawValue] (&content, UnsafeMutableRawPointer(mutating: nil))
gi.variant_new_nil (UnsafeMutablePointer (&content))
return
}
Variant.fromTypeMap [GType.object.rawValue] (&content, UnsafeMutableRawPointer (mutating: value.handle))
Expand Down

0 comments on commit a1ea286

Please sign in to comment.