clover / clover-android-sdk

Clover SDK for developing applications on Clover Station/Mobile/Mini/Flex

Home Page:https://docs.clover.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LineItem.java #684 hasDiscounts() Returns Null

bryannevega opened this issue · comments

If the object doesn't have any discounts the line item object doesn't have a "hasDiscounts" boolean field nor the method returns false.

In order to avoid the issue, I use
lineItem.getDiscounts != null
where it could be :

if(lineItem.hasDiscounts){
//Logic
}

Is this the intended behavior or can this be considered into implementation?

To use in the if condition, it should return a Boolean value, in your case it does not.

To use in the if condition, it should return a Boolean value, in your case it does not.

Exactly, it always returns a NPE because the object itself doesn't have a field "hasDiscounts".