Skip to content

Commit

Permalink
fix null item property error
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Jul 11, 2024
1 parent 8a9e870 commit a35d6e5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/modules/property-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import i18n from '../i18n.js';

const zonesFormat = (zones) => {
return zones
?.map((zoneName) => {
if (zoneName === zoneName.toUpperCase()) {
return zoneName.charAt(0).toUpperCase() + zoneName.substr(1).toLowerCase();
}

return zoneName;
})
.filter(Boolean)
.sort()
.join(' · ')
?.map((zoneName) => {
if (zoneName === zoneName.toUpperCase()) {
return zoneName.charAt(0).toUpperCase() + zoneName.substr(1).toLowerCase();
}

return zoneName;
})
.filter(Boolean)
.sort()
.join(' · ');
}

const ignoreCategories = [
Expand Down Expand Up @@ -51,7 +51,7 @@ const formatter = (key, value, id) => {
}
value = value.value;
}
if (typeof value === 'object') {
if (typeof value === 'object' && value !== null) {
if (Array.isArray(value)) {
value = [...value];
} else {
Expand Down

0 comments on commit a35d6e5

Please sign in to comment.