We have price getters on the product (getPrice), line item (getUnitPrice, getTotalPrice), order (getTotalPrice), payment (getAmount, getRefundedAmount).
Each of these always returns a Price object. But the underlying field items can be empty, since Drupal entities don't need to be in a valid state when initialized or saved. If the field item is empty, then the getter should return NULL, not a Price object (because the Price object can't be valid, and because that's what other similar getters do).

Comments

bojanz created an issue. See original summary.

bojanz’s picture

Assigned: Unassigned » bojanz

  • bojanz committed 2319ce0 on 8.x-2.x
    Issue #2791001 by bojanz: Entity price getters need to account for empty...
bojanz’s picture

Status: Active » Fixed

Boom.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.