-
Notifications
You must be signed in to change notification settings - Fork 837
fix: avoid crash when readability parser returns null #865
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
fix: avoid crash when readability parser returns null #865
The head ref may contain hidden characters: "codex/\u5C0B\u627E\u4E26\u4FEE\u5FA9\u7A0B\u5F0F\u78BC\u932F\u8AA4"
Conversation
WalkthroughThe update refines the logic for extracting article content using the Readability library. It introduces stricter checks to ensure the article and its text content exist before processing, and changes a variable declaration from Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
@coderabbitai review |
✅ Actions performedReview triggered.
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a bug in getCoreContentText by adding a null check to prevent crashes when the Readability parser returns null. Key changes include:
- Introducing an if/else block to safely handle article.textContent.
- Adding additional logging statements to indicate parsing success or failure.
✅ Actions performedReview triggered.
|
User description
It's a patch generated by OpenAI Codex, which we could use as a trial run and test lab. We can also review the feedback from other agents.
Summary from GitHub Copilot:
PR Type
Bug fix
Description
Prevents crash when Readability parser returns null
Adds null check for
article.textContent
before processingUses
const
instead oflet
for article declarationChanges walkthrough 📝
get-core-content-text.mjs
Add null check for Readability parser output
src/utils/get-core-content-text.mjs
article.textContent
before processinglet
toconst
for article variableSummary by CodeRabbit