Hello everyone,
I'm getting the "java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.clover.common2.clover.Clover.getUserOrderTypes()' on a null object reference" exception on an attempt to use the connector.createLineItemsFrom() method.
My steps are next:
- Register an Activity to be aware of the clover.intent.action.MODIFY_ORDER intent.
- In the Register app create order with two or more items and tap Pay.
- On the Register's Payment activity tap the custom button to start the Activity.
- The Activity contains Split Order button that runs code like next:
override suspend fun splitOrder( orderId: OrderId, // just a wrapper around the Order.id string lineItems: List<LineItem>, ): Order { val connector = connector.first() // provides OrderConnector instance return withContext(Dispatchers.IO) { try { val order = connector.createOrder(Order()) val items = connector.createLineItemsFrom(orderId.value, order.id, lineItems.map { it.id }) connector.getOrder(order.id) } catch (e: Exception) { throw e } } }
it fails on the connector.createLineItemsFrom() line, I tried to use the deprecated copyLineItems with exactly same result.
I'm trying to work around this issue with implementing a Split Order functionality through Inventory but it is hard to manage and update two orders.
I found similar topic here but unfortunately w/o a clear response https://community.clover.com/questions/30998/orderconnector-createlineitemsfrom-has-stopped-wor.html
This one could be similar as well https://community.clover.com/questions/23506/split-customer-amount-issue-with-adding-discount-u.html
Any help would be appreciated.
Thanks