Skip to content

Commit fa56ada

Browse files
Merge remote-tracking branch 'origin/master' into master
2 parents ffbe802 + a7013ee commit fa56ada

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/Commands/GedcomImporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace GenealogiaWebsite\LaravelGedcom\Commands;
44

5-
use Illuminate\Console\Command;
65
use GenealogiaWebsite\LaravelGedcom\Facades\GedcomParserFacade;
6+
use Illuminate\Console\Command;
77

88
class GedcomImporter extends Command
99
{

src/Utils/GedcomParser.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private function getPerson($individual)
272272
$attr = $individual->getAllAttr();
273273
$events = $individual->getAllEven();
274274
$note = $individual->getNote();
275-
$sour = $individual->getSour();
275+
$indv_sour = $individual->getSour();
276276
$alia = $individual->getAlia(); // string array
277277
$asso = $individual->getAsso();
278278
$subm = $individual->getSubm();
@@ -314,17 +314,23 @@ private function getPerson($individual)
314314
$_gid = $person->id;
315315
if ($names != null && count($names) > 0) {
316316
foreach ($names as $item) {
317-
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\Indi\Name::read($this->conn, $item, $_group, $_gid);
317+
if ($item) {
318+
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\Indi\Name::read($this->conn, $item, $_group, $_gid);
319+
}
318320
}
319321
}
320322
if ($note != null && count($note) > 0) {
321323
foreach ($note as $item) {
322-
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\NoteRef::read($this->conn, $item, $_group, $_gid);
324+
if ($item) {
325+
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\NoteRef::read($this->conn, $item, $_group, $_gid);
326+
}
323327
}
324328
}
325-
if ($sour !== null && count($sour) > 0) {
326-
foreach ($sour as $item) {
327-
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\SourRef::read($this->conn, $item, $_group, $_gid, $this->sour_ids, $this->obje_ids);
329+
if ($indv_sour != null && count($indv_sour) > 0) {
330+
foreach ($indv_sour as $item) {
331+
if ($item) {
332+
\GenealogiaWebsite\LaravelGedcom\Utils\Importer\SourRef::read($this->conn, $item, $_group, $_gid, $this->sour_ids, $this->obje_ids);
333+
}
328334
}
329335
}
330336

0 commit comments

Comments
 (0)