summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2013-07-05 23:18:59 +0000
committerfisharebest <fisharebest@gmail.com>2013-07-05 23:18:59 +0000
commitda4602e137d2acdd55a03e33da788e7c3846af2c (patch)
tree42970c867568a91e7fc0902218eeb97645c1b477
parentcdfc6fea5b5bbe301c88744960d0b459e2c0a7e6 (diff)
downloadwebtrees-da4602e137d2acdd55a03e33da788e7c3846af2c.tar.gz
webtrees-da4602e137d2acdd55a03e33da788e7c3846af2c.tar.bz2
webtrees-da4602e137d2acdd55a03e33da788e7c3846af2c.zip
PHP error when no parents
-rw-r--r--includes/functions/functions_charts.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/functions/functions_charts.php b/includes/functions/functions_charts.php
index 5d9369f26d..9ebc7e3557 100644
--- a/includes/functions/functions_charts.php
+++ b/includes/functions/functions_charts.php
@@ -126,7 +126,7 @@ function print_family_parents(WT_Family $family, $sosa=0, $label='', $parid='',
echo "<td rowspan=\"2\"><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td rowspan=\"2\"><img src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"" . ($pbheight+9) . "\" alt=\"\"></td>";
echo "<td><img class=\"line5\" src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td>";
// husband's father
- if ($hfam->getHusband()) {
+ if ($hfam && $hfam->getHusband()) {
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
if ($sosa > 0) print_sosa_number($sosa * 4, $hfam->getHusband()->getXref(), "down");
if (!empty($gparid) && $hfam->getHusband()->getXref()==$gparid) print_sosa_number(trim(substr($label,0,-3),".").".");
@@ -144,7 +144,7 @@ function print_family_parents(WT_Family $family, $sosa=0, $label='', $parid='',
if ($hfam || $sosa) {
// husband's mother
echo "</tr><tr><td><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td>";
- if ($hfam->getWife()) {
+ if ($hfam && $hfam->getWife()) {
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
if ($sosa > 0) print_sosa_number($sosa * 4 + 1, $hfam->getWife()->getXref(), "down");
if (!empty($gparid) && $hfam->getWife()->getXref()==$gparid) print_sosa_number(trim(substr($label,0,-3),".").".");
@@ -197,7 +197,7 @@ function print_family_parents(WT_Family $family, $sosa=0, $label='', $parid='',
echo "<td rowspan=\"2\"><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td rowspan=\"2\"><img src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"" . ($pbheight+9) . "\" alt=\"\"></td>";
echo "<td><img class=\"line5\" src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td>";
// wife's father
- if ($hfam->getHusband()) {
+ if ($hfam && $hfam->getHusband()) {
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\"><tr>";
if ($sosa > 0) print_sosa_number($sosa * 4 + 2, $hfam->getHusband()->getXref(), "down");
if (!empty($gparid) && $hfam->getHusband()->getXref()==$gparid) print_sosa_number(trim(substr($label,0,-3),".").".");
@@ -215,7 +215,7 @@ function print_family_parents(WT_Family $family, $sosa=0, $label='', $parid='',
if ($hfam || $sosa) {
// wife's mother
echo "</tr><tr><td><img src=\"".$WT_IMAGES["hline"]."\" alt=\"\"></td><td>";
- if ($hfam->getWife()) {
+ if ($hfam && $hfam->getWife()) {
echo "<table style=\"width: " . ($pbwidth) . "px; height: " . $pbheight . "px;\"><tr>";
if ($sosa > 0) print_sosa_number($sosa * 4 + 3, $hfam->getWife()->getXref(), "down");
if (!empty($gparid) && $hfam->getWife()->getXref()==$gparid) print_sosa_number(trim(substr($label,0,-3),".").".");