summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Amorim <[email protected]>2018-03-14 10:51:24 +0100
committerPedro Amorim <[email protected]>2018-03-14 15:22:36 +0100
commitd892b1376809c454980ce7083e6cee67d47e6b26 (patch)
treefbc90b419c84323671be792bd0d10963d67b0966
parentf0f69065301d640ccf7308cff7c1eb006d03ef45 (diff)
Fix error C14N
I have the error: "Call to a member function C14N() on null" You could reproduce like this: - try to parse a url like http://www.dailymotion.com/video/x6ga6qi that doesn't return any content - this throw an exception and the logs show "[Parsing] Could not parse text, giving up :(" - now, call ->getContent() with the same object readability Previously, getContent would return "null" but now it call ->C14N() on a NULL object.
-rw-r--r--src/Readability.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 91e703c..cffe4f0 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -1564,7 +1564,7 @@ class Readability
*/
public function getContent()
{
- return $this->content->C14N();
+ return (null !== $this->content) ? $this->content->C14N() : null;
}
/**