diff options
| author | Greg Roach <fisharebest@gmail.com> | 2021-04-12 19:10:34 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2021-04-12 19:11:02 +0100 |
| commit | 3b2b4ad36d345c0b8edd7c7fbfa0496cd51bf73a (patch) | |
| tree | 9c25c2846e7bd9cc0a840ea47e0c30d7bbec0644 | |
| parent | a7503b1c38e47323e9010dcb169070a4a1eea044 (diff) | |
| download | webtrees-3b2b4ad36d345c0b8edd7c7fbfa0496cd51bf73a.tar.gz webtrees-3b2b4ad36d345c0b8edd7c7fbfa0496cd51bf73a.tar.bz2 webtrees-3b2b4ad36d345c0b8edd7c7fbfa0496cd51bf73a.zip | |
Check record still exists in relationship chart URL
| -rw-r--r-- | app/Module/RelationshipsChartModule.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/Module/RelationshipsChartModule.php b/app/Module/RelationshipsChartModule.php index ccb8d42b30..553c755c34 100644 --- a/app/Module/RelationshipsChartModule.php +++ b/app/Module/RelationshipsChartModule.php @@ -136,12 +136,14 @@ class RelationshipsChartModule extends AbstractModule implements ModuleChartInte if ($my_xref !== '' && $my_xref !== $individual->xref()) { $my_record = Registry::individualFactory()->make($my_xref, $individual->tree()); - return new Menu( - I18N::translate('Relationship to me'), - $this->chartUrl($my_record, ['xref2' => $individual->xref()]), - $this->chartMenuClass(), - $this->chartUrlAttributes() - ); + if ($my_record instanceof Individual) { + return new Menu( + I18N::translate('Relationship to me'), + $this->chartUrl($my_record, ['xref2' => $individual->xref()]), + $this->chartMenuClass(), + $this->chartUrlAttributes() + ); + } } return new Menu( |
