diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-09-27 09:12:22 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-09-27 09:12:22 +0100 |
| commit | 44f3c1494a4da70175ffd2d40aa661783f529868 (patch) | |
| tree | 10cb5d30ed279aa3eb56423db0b7ab1227da7d40 /app/Census/CensusColumnChildrenDied.php | |
| parent | a53db70de9092a80529e77db445001f1acf43696 (diff) | |
| download | webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.tar.gz webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.tar.bz2 webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.zip | |
Unit tests
Diffstat (limited to 'app/Census/CensusColumnChildrenDied.php')
| -rw-r--r-- | app/Census/CensusColumnChildrenDied.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Census/CensusColumnChildrenDied.php b/app/Census/CensusColumnChildrenDied.php index 249f42d4b0..fc7be84dc0 100644 --- a/app/Census/CensusColumnChildrenDied.php +++ b/app/Census/CensusColumnChildrenDied.php @@ -37,7 +37,13 @@ class CensusColumnChildrenDied extends AbstractCensusColumn implements CensusCol $count = 0; foreach ($individual->getSpouseFamilies() as $family) { foreach ($family->getChildren() as $child) { - if (Date::compare($child->getBirthDate(), $this->date()) < 0 && $child->getBirthDate() != $child->getDeathDate() && Date::compare($child->getDeathDate(), $this->date()) < 0) { + if ( + $child->getBirthDate()->isOK() && + Date::compare($child->getBirthDate(), $this->date()) < 0 && + $child->getBirthDate() != $child->getDeathDate() && + $child->getDeathDate()->isOK() && + Date::compare($child->getDeathDate(), $this->date()) < 0 + ) { $count++; } } |
