PureSwift / DBus

Swift library for D-Bus
MIT License
13 stars 7 forks source link

DBusError.Reference() internalValue nil exception #5

Open Inokinoki opened 5 years ago

Inokinoki commented 5 years ago

Thanks for your helpful library !

I imported and created a DBusConnection on macOS.

let conn = try DBusConnection.init(address: "/tmp/dbus-1AGCwnZNuj", shared: false);

An error occured Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value.

It seems that padding1 is nil which caused this problem.

I changed internal let internalPointer: OpaquePointer? to fix it. The situation is that when there is error in connection, the returned pointer is NULL/nil.

image

My Swift version is Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5) Target: x86_64-apple-darwin18.6.0.

Thanks in advance !

Inokinoki commented 5 years ago

Should I add some code to handle it ?