diff --git a/descendancy.php b/descendancy.php
index <HASH>..<HASH> 100644
--- a/descendancy.php
+++ b/descendancy.php
@@ -131,7 +131,9 @@ function indi_desc($person, $n, $array) {
 	$array[$person->getXref()]=$person;
 	foreach ($person->getSpouseFamilies() as $family) {
 		$spouse = $family->getSpouse($person);
-		$array[$spouse->getXref()] = $spouse;
+		if ($spouse) {
+			$array[$spouse->getXref()] = $spouse;
+		}
 		foreach ($family->getChildren() as $child) {
 			$array=indi_desc($child, $n-1, $array);
 		}
Fix: one-parent family causes PHP error in descendancy chart / individual list