Skip to content

Commit

Permalink
try fix phan
Browse files Browse the repository at this point in the history
  • Loading branch information
fappels committed Jun 24, 2024
1 parent 92f4265 commit e05dd6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/bom/class/bom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ public function getNetNeedsTree(&$TNetNeeds = array(), $qty = 0, $level = 0)
// When using nested level (or not), the qty for needs must always use the same unit to be able to be cumulated.
// So if unit in bom is not the same than default, we must recalculate qty after units comparisons.
$TNetNeeds[$this->id]['product'][$line->fk_product]['fk_unit'] = $line->fk_unit;
if (isset($TNetNeeds[$this->id]['product']) && isset($TNetNeeds[$this->id]['product'][$line->fk_product]['qty'])) {
if (isset($TNetNeeds[$this->id]) && isset($TNetNeeds[$this->id]['product'][$line->fk_product]['qty'])) {
$TNetNeeds[$this->id]['product'][$line->fk_product]['qty'] += $line->qty * $qty;

Check warning on line 1580 in htdocs/bom/class/bom.class.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

bom.class.php: PhanTypeArraySuspiciousNullable: Suspicious array access to $TNetNeeds[$this->id]['product'] of nullable type array<int,array{fk_unit:int|non-zero-int|null}>|null
} else {
$TNetNeeds[$this->id]['product'][$line->fk_product]['qty'] = $line->qty * $qty;
Expand Down

0 comments on commit e05dd6d

Please sign in to comment.