Skip to content

Commit

Permalink
Patch Call to a member function getHeight() on array
Browse files Browse the repository at this point in the history
  • Loading branch information
lerni authored Jul 6, 2022
1 parent b28e229 commit 9916133
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/FieldType/DBFocusPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ public function getWidth(): int
if ($width) {
return intval($width);
}
if ($this->record) {
return intval(is_array($this->record) ? $this->record["Width"] : $this->record->getWidth());
if (is_object($this->record)) {
return intval($this->record->getWidth());
}
if (is_array($this->record) && isset($this->record['Width'])) {
return intval($this->record['Width']);
}

return 0;
Expand All @@ -94,9 +97,13 @@ public function getHeight(): int
if ($height) {
return intval($height);
}
if ($this->record) {
return intval(is_array($this->record) ? $this->record["Height"] : $this->record->getHeight());
if (is_object($this->record)) {
return intval($this->record->getHeight());
}
if (is_array($this->record) && isset($this->record['Height'])) {
return intval($this->record['Height']);
}

return 0;
}

Expand Down

0 comments on commit 9916133

Please sign in to comment.