Skip to content

Commit

Permalink
fix null error
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Apr 30, 2024
1 parent 13325be commit 715bb85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions public/javascripts/bylaw-maint.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
});
}
function renderBylawListFunction() {
var _a, _b;
var _a, _b, _c;
let displayCount = 0;
const bylawFilterSplit = bylawFilterElement.value
.trim()
Expand Down Expand Up @@ -129,9 +129,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
}
else {
hasOffences = true;
offenceAmountRange = `$${bylaw.offenceAmountMin.toFixed(2)}`;
offenceAmountRange = `$${((_a = bylaw.offenceAmountMin) !== null && _a !== void 0 ? _a : 0).toFixed(2)}`;
if (bylaw.offenceAmountMin !== bylaw.offenceAmountMax) {
offenceAmountRange += ` to $${((_a = bylaw.offenceAmountMax) !== null && _a !== void 0 ? _a : 0).toFixed(2)}`;
offenceAmountRange += ` to $${((_b = bylaw.offenceAmountMax) !== null && _b !== void 0 ? _b : 0).toFixed(2)}`;
}
offenceAmountRange = `<a class="has-tooltip-left" data-tooltip="Update Offence Amounts" data-index="${bylawIndex.toString()}" href="#">
${offenceAmountRange}
Expand All @@ -146,7 +146,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
${cityssm.escapeHTML(bylaw.bylawDescription)}
</td>
<td class="has-text-right">
${((_b = bylaw.offenceCount) !== null && _b !== void 0 ? _b : 0).toString()}
${((_c = bylaw.offenceCount) !== null && _c !== void 0 ? _c : 0).toString()}
</td>
<td class="has-text-right">
${offenceAmountRange}
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/bylaw-maint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ type UpdateBylawResponseJSON =
} else {
hasOffences = true

offenceAmountRange = `$${bylaw.offenceAmountMin.toFixed(2)}`
offenceAmountRange = `$${(bylaw.offenceAmountMin ?? 0).toFixed(2)}`

if (bylaw.offenceAmountMin !== bylaw.offenceAmountMax) {
offenceAmountRange += ` to $${(bylaw.offenceAmountMax ?? 0).toFixed(
Expand Down

0 comments on commit 715bb85

Please sign in to comment.