While the SDK declares nullability for various completion handlers as nullable, the reality is that the SDK crashes if nil is passed.
For example:
PayPalRetailSDK.deviceManager()!.getActiveReader()?.disconnect(nil) <- crash
-------
var _transactionContext: PPRetailTransactionContext?
...
_transactionContext?.setCompletedHandler(nil)
PayPalRetailSDK.deviceManager()!.getActiveReader()?.disconnect({ _ in }) <- crash when invoking the completed handler
Please either correct the nullability annotations so that nil can't be passed in, or check if the completion handler is not NULL.
While the SDK declares nullability for various completion handlers as
nullable
, the reality is that the SDK crashes ifnil
is passed.For example:
Please either correct the nullability annotations so that
nil
can't be passed in, or check if the completion handler is notNULL
.