dompdf icon indicating copy to clipboard operation
dompdf copied to clipboard

I have a DivisionByZeroError due to a null value in the division

Open mmanzano opened this issue 5 months ago • 2 comments

This line is protecting us from 0.0 value but not for null values. Is there a reason to not think about an scenario where $rightValue could be null?

https://github.com/dompdf/dompdf/blob/e83283715efe39806b64d3bdae7974d4400f711a/src/Css/Style.php#L1355

I have problems due to that when I use tailwind in order to styling a document. In my end when I remove the line @tailwind components the issue is gone so I don't know if something is wrong in Tailwind. I've tried to change the condition to $rightValue === null || $rightValue === 0.0 and it works. Could I make a PR with this?. I'm asking because maybe I'm missing something. I don't want to do the PR without explaining my reasoning before.

mmanzano avatar Sep 24 '24 09:09 mmanzano