Open rakoo opened 3 months ago
Bridge | Context | Status |
---|---|---|
HackerNewsUserThreads | 1 untitled (current) | ❌ Bridge returned error 0! (19956) ❌ Type: ErrorException ❌ Message: Attempt to read property "innertext" on null |
HackerNewsUserThreads | 1 untitled (pr) | ❌ Bridge returned error 0! (19956) ❌ Type: ErrorException ❌ Message: Attempt to read property "innertext" on null |
last change: Wednesday 2024-08-21 18:16:34
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
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 ?
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))
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
Caution: this is untested because I have trouble running the docker command, but it's minor