Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notice: Trying to get property '' of non-object #12

Closed
thedf opened this issue Jan 9, 2023 · 3 comments
Closed

Notice: Trying to get property '' of non-object #12

thedf opened this issue Jan 9, 2023 · 3 comments

Comments

@thedf
Copy link

thedf commented Jan 9, 2023

Hey there,

I am facing the following notices about getting properties of non-objects when using this library for articles from this feed:

Trying to get property 'length' of non-object in /PATH/vendor/fivefilters/readability.php/src/Readability.php on line 1514
Trying to get property 'textContent' of non-object in /PATH/vendor/fivefilters/readability.php/src/Readability.php on line 207
Trying to get property 'childNodes' of non-object in /PATH/vendor/fivefilters/readability.php/src/Readability.php on line 1506
fivefilters added a commit that referenced this issue Jan 14, 2023
@fivefilters
Copy link
Owner

Thanks for reporting this @thedf! The latest version (3.1.2) should fix it. Please let us know if you still have trouble with it.

@thedf
Copy link
Author

thedf commented Jan 16, 2023

Thanks for the quick fix and release. I will keep you in touch if I find any other problems.

@thedf
Copy link
Author

thedf commented Feb 17, 2023

Hey @fivefilters , we are getting this error instead in php8.1.
Attempt to read property "length" on null in /PATH/vendor/fivefilters/readability.php/src/Readability.php on line 1514

it's probably better to make the fix something like this :
vendor/fivefilters/readability.php/src/Readability.php:1506 : $siblings = $parentOfTopCandidate->childNodes ?? [];

Thanks for your attention on this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants