Skip to content

Commit

Permalink
fix(cb2-11687): Fix empty adr details causing filter to break (#1595)
Browse files Browse the repository at this point in the history
* fix(cb2-11687): fix empty adr details

* fix(cb2-11687): lint fix
  • Loading branch information
tomcrawleyy authored Sep 19, 2024
1 parent 2a68cf9 commit 7598889
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export class AdrPermittedDangerousGoodsComponent
if (this.adrBodyType?.includes('battery') || this.adrBodyType?.includes('tank')) {
let currentValue: string[] = this.control?.value?.value;
if (
currentValue.includes(ADRDangerousGood.EXPLOSIVES_TYPE_2) ||
currentValue.includes(ADRDangerousGood.EXPLOSIVES_TYPE_3)
currentValue &&
(currentValue.includes(ADRDangerousGood.EXPLOSIVES_TYPE_2) ||
currentValue.includes(ADRDangerousGood.EXPLOSIVES_TYPE_3))
) {
currentValue = currentValue.filter(
(value) => value !== ADRDangerousGood.EXPLOSIVES_TYPE_3 && value !== ADRDangerousGood.EXPLOSIVES_TYPE_2
Expand Down

0 comments on commit 7598889

Please sign in to comment.