rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

[HackerNews] Fix tag containing comment

Open rakoo opened this issue 1 year ago • 5 comments

Caution: this is untested because I have trouble running the docker command, but it's minor

rakoo avatar Aug 21 '24 18:08 rakoo

Pull request artifacts

Bridge Context Status
HackerNewsUserThreads 1 untitled (current) Bridge returned error 0! (20390)
Type: ErrorException
Message: Attempt to read property "innertext" on null
HackerNewsUserThreads 1 untitled (pr) ✔️

last change: Wednesday 2025-10-29 21:09:29

github-actions[bot] avatar Aug 21 '24 18:08 github-actions[bot]

it already broken from before.

your suggestion suffers the same fate:

Details
Type: ErrorException
Code: 0
Message: Attempt to read property "innertext" on null
File: bridges/HackerNewsUserThreadsBridge.php
Line: 43

dvikan avatar Aug 21 '24 20:08 dvikan

So, I don't know how to fix this; it now "works on my machine" (but I know how bad this sentence is)

Any help on what I can do to have a look at that ?

rakoo avatar Sep 19 '24 17:09 rakoo

I dug into this a bit and it looks like the .innertext in line 43 is correct in general.

Is it possible that the innertext might be empty for some comments? If the comment is an image for example? I'm not sure of the capabilities of the thread board.

Can you add an error handling if the innertext of the comment is empty, then just set it to "" or something?

if (empty($element->find('span[class*="commtext"]', 0)->innertext))

Bockiii avatar Oct 18 '24 07:10 Bockiii

No, HackerNews is a text-only message board. Moreove the error seemed to be related to the containing div being null. I put a null-check on it.

The build is broken because of #4310, fixed in #4311

rakoo avatar Oct 19 '24 22:10 rakoo

This fixes the bridge, merging. The rebase on master fixed the build issues.

Mynacol avatar Oct 29 '25 21:10 Mynacol