diff options
| author | Greg Roach <fisharebest@gmail.com> | 2013-08-16 08:43:58 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2013-08-16 08:43:58 +0100 |
| commit | a73f6d4e08aa4e05e8b8ebc6d1f040d5a2cdfb20 (patch) | |
| tree | 1a8aced716d0a11ad5135745673f46a48d15c4a1 /library/WT/Controller | |
| parent | e8e834d0196486623e62b395fbdc6cf6523002f1 (diff) | |
| download | webtrees-a73f6d4e08aa4e05e8b8ebc6d1f040d5a2cdfb20.tar.gz webtrees-a73f6d4e08aa4e05e8b8ebc6d1f040d5a2cdfb20.tar.bz2 webtrees-a73f6d4e08aa4e05e8b8ebc6d1f040d5a2cdfb20.zip | |
One-parent family causes PHP error in fan chart
Diffstat (limited to 'library/WT/Controller')
| -rw-r--r-- | library/WT/Controller/Fanchart.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/WT/Controller/Fanchart.php b/library/WT/Controller/Fanchart.php index d5b508c9f4..9f10272123 100644 --- a/library/WT/Controller/Fanchart.php +++ b/library/WT/Controller/Fanchart.php @@ -319,9 +319,11 @@ class WT_Controller_Fanchart extends WT_Controller_Chart { // spouse(s) and children foreach ($person->getSpouseFamilies() as $family) { $spouse=$family->getSpouse($person); - $html.= '<br><a href="'.$spouse->getHtmlUrl().'" class="name1">'.$spouse->getFullName().'</a>'; - foreach ($family->getChildren() as $child) { - $html.= '<br> <a href="'.$child->getHtmlUrl().'" class="name1">< '.$child->getFullName().'</a>'; + if ($spouse) { + $html.= '<br><a href="'.$spouse->getHtmlUrl().'" class="name1">'.$spouse->getFullName().'</a>'; + foreach ($family->getChildren() as $child) { + $html.= '<br> <a href="'.$child->getHtmlUrl().'" class="name1">< '.$child->getFullName().'</a>'; + } } } // siblings |
