Skip to content

Commit

Permalink
Merge pull request #1320 from sakisdog/fix-undefined-error-formatter
Browse files Browse the repository at this point in the history
Fix for TypeError crash on null values for some attributes
  • Loading branch information
tananaev authored Jan 6, 2025
2 parents e109272 + 3b4f7ba commit 8c45385
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/components/PositionValue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ const PositionValue = ({ position, property, attribute }) => {
return formatAltitude(value, altitudeUnit, t);
case 'power':
case 'battery':
return formatVoltage(value, t);
return value != null ? formatVoltage(value, t) : '';
case 'batteryLevel':
return value != null ? formatPercentage(value, t) : '';
return value != null ? formatPercentage(value) : '';
case 'volume':
return value != null ? formatVolume(value, volumeUnit, t) : '';
case 'fuelConsumption':
return value != null ? formatConsumption(value, t) : '';
case 'coolantTemp':
return formatTemperature(value);
return value != null ? formatTemperature(value) : '';
case 'alarm':
return formatAlarm(value, t);
case 'odometer':
Expand Down

0 comments on commit 8c45385

Please sign in to comment.