Skip to content

Commit

Permalink
attempt fix publish error: .trim is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvicenti committed Dec 10, 2024
1 parent 4b0be70 commit 01d63f5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ function getParentBlock(block: HMBlock) {

function toNumber(value?: string): number | null {
// Handle empty or whitespace-only strings
if (!value || value.trim() === '') {
if (!value) return null
if (typeof value !== 'string') {
console.error('Unexpected numeric value is not a string: ', value)
return null
}
if (value.trim() === '') {
return null
}

Expand Down

0 comments on commit 01d63f5

Please sign in to comment.