summaryrefslogtreecommitdiff
path: root/library/WT/Controller
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-08-16 08:43:58 +0100
committerGreg Roach <fisharebest@gmail.com>2013-08-16 08:43:58 +0100
commita73f6d4e08aa4e05e8b8ebc6d1f040d5a2cdfb20 (patch)
tree1a8aced716d0a11ad5135745673f46a48d15c4a1 /library/WT/Controller
parente8e834d0196486623e62b395fbdc6cf6523002f1 (diff)
downloadwebtrees-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.php8
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>&nbsp;&nbsp;<a href="'.$child->getHtmlUrl().'" class="name1">&lt; '.$child->getFullName().'</a>';
+ if ($spouse) {
+ $html.= '<br><a href="'.$spouse->getHtmlUrl().'" class="name1">'.$spouse->getFullName().'</a>';
+ foreach ($family->getChildren() as $child) {
+ $html.= '<br>&nbsp;&nbsp;<a href="'.$child->getHtmlUrl().'" class="name1">&lt; '.$child->getFullName().'</a>';
+ }
}
}
// siblings