Skip to content

Commit 4db1071

Browse files
committed
Do not try to save empty data
The dbase extension segfaults on this. Signed-off-by: Michal Čihař <[email protected]>
1 parent 741e2f7 commit 4db1071

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ShapeRecord.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ private function _loadDBFData() {
708708
}
709709

710710
private function _saveDBFData() {
711+
if (count($this->DBFData) == 0) {
712+
return;
713+
}
711714
unset($this->DBFData['deleted']);
712715
if ($this->recordNumber <= dbase_numrecords($this->DBFFile)) {
713716
if (!dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) {

0 commit comments

Comments
 (0)