summaryrefslogtreecommitdiff
path: root/vendor/league/commonmark/src/Node/Node.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-08-05 20:42:16 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-08-05 20:42:16 +0100
commit476e0b588a14416aec7c66ec164d42c88feb20c7 (patch)
treeeef36ca3f612b99c02c6a2c0dcea692f5ee7d262 /vendor/league/commonmark/src/Node/Node.php
parentb092a991966b26dd39ccaaf816cf80a5c0379ded (diff)
downloadwebtrees-476e0b588a14416aec7c66ec164d42c88feb20c7.tar.gz
webtrees-476e0b588a14416aec7c66ec164d42c88feb20c7.tar.bz2
webtrees-476e0b588a14416aec7c66ec164d42c88feb20c7.zip
Update dependencies
Diffstat (limited to 'vendor/league/commonmark/src/Node/Node.php')
-rw-r--r--vendor/league/commonmark/src/Node/Node.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/vendor/league/commonmark/src/Node/Node.php b/vendor/league/commonmark/src/Node/Node.php
index 17f373ccca..46df3a6540 100644
--- a/vendor/league/commonmark/src/Node/Node.php
+++ b/vendor/league/commonmark/src/Node/Node.php
@@ -1,5 +1,17 @@
<?php
+/*
+ * This file is part of the league/commonmark package.
+ *
+ * (c) Colin O'Dell <colinodell@gmail.com>
+ *
+ * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
+ * - (c) John MacFarlane
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
namespace League\CommonMark\Node;
abstract class Node
@@ -85,7 +97,7 @@ abstract class Node
$this->next = $sibling;
$sibling->setParent($this->parent);
- if (!$sibling->next) {
+ if (!$sibling->next && $sibling->parent) {
$sibling->parent->lastChild = $sibling;
}
}
@@ -108,7 +120,7 @@ abstract class Node
$this->previous = $sibling;
$sibling->setParent($this->parent);
- if (!$sibling->previous) {
+ if (!$sibling->previous && $sibling->parent) {
$sibling->parent->firstChild = $sibling;
}
}