Skip to content

Commit

Permalink
fix array input in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbrix committed Dec 23, 2024
1 parent bbf567c commit 572a46f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions swiftwinrt/Resources/Support/IInspectable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public enum __ABI_ {
return makeFrom(abi: ref) ?? ref
}
public static func tryUnwrapFrom(raw pUnk: UnsafeMutableRawPointer?) -> AnyObject? {
tryUnwrapFromBase(raw: pUnk)
guard let pUnk else { return nil }
return tryUnwrapFromBase(raw: pUnk)
}

internal static func queryInterface(_ pUnk: UnsafeMutablePointer<C_IInspectable>?, _ riid: UnsafePointer<SUPPORT_MODULE.IID>?, _ ppvObject: UnsafeMutablePointer<UnsafeMutableRawPointer?>?) -> HRESULT {
Expand Down Expand Up @@ -151,11 +152,9 @@ public enum __IMPL_ {
}

public static func from(abi: ComPtr<CABI>?) -> SwiftProjection? {
// This code path is not actually reachable since IBufferByteAccess is not a WinRT interface.
// It is a COM interface which is implemented by any object which implements the IBuffer interface.
// And the IBufferImpl object will correctly have the implementation of this interface, so this isn't needed
assertionFailure("IBufferByteAccessBridge.from not implemented")
return nil
guard let abi else { return nil }
let ref = IInspectable(abi)
return makeFrom(abi: ref) ?? ref
}

public typealias SwiftProjection = Any
Expand Down

0 comments on commit 572a46f

Please sign in to comment.