소스 검색

fix(core): Fix regression in accessing OrderLine.items when not defined

Michael Bromley 3 년 전
부모
커밋
3fcf5dc89d
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/core/src/entity/order-line/order-line.entity.ts

+ 1 - 1
packages/core/src/entity/order-line/order-line.entity.ts

@@ -291,7 +291,7 @@ export class OrderLine extends VendureEntity implements HasCustomFields {
         prop: K,
         defaultVal: OrderItem[K],
     ): OrderItem[K] {
-        const items = this.activeItems.length ? this.activeItems : this.items;
+        const items = this.activeItems.length ? this.activeItems : this.items ?? [];
         return items.length ? items[0][prop] : defaultVal;
     }
 }