Skip to content

Commit 75bf84f

Browse files
authored
Merge pull request #887 from taophp/patch-1
Fix division by zero
2 parents ac4180e + 1a1b362 commit 75bf84f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpWord/Writer/ODText/Style/Paragraph.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function write()
3535
}
3636
$xmlWriter = $this->getXmlWriter();
3737

38-
$marginTop = is_null($style->getSpaceBefore()) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
39-
$marginBottom = is_null($style->getSpaceAfter()) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
38+
$marginTop = ($style->getSpaceBefore() ==0 ) ? '0' : round(17.6 / $style->getSpaceBefore(), 2);
39+
$marginBottom = ($style->getSpaceAfter() == 0) ? '0' : round(17.6 / $style->getSpaceAfter(), 2);
4040

4141
$xmlWriter->startElement('style:style');
4242
$xmlWriter->writeAttribute('style:name', $style->getStyleName());

0 commit comments

Comments
 (0)