Check for null before logging download status#3561
Open
bmschwa wants to merge 3 commits intonextcloud:masterfrom
Open
Check for null before logging download status#3561bmschwa wants to merge 3 commits intonextcloud:masterfrom
bmschwa wants to merge 3 commits intonextcloud:masterfrom
Conversation
SMillerDev
reviewed
Feb 10, 2026
Contributor
SMillerDev
left a comment
There was a problem hiding this comment.
fix: set fallback value for missing error message
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents news:updater:update-feed from throwing a TypeError when a feed update fails but getLastUpdateError() returns null, by falling back to a generated error message.
Changes:
- Capture
getLastUpdateError()into a variable and provide a fallback message when it isnull. - Ensure
OutputInterface::writeln()always receives a non-null string in the update-error path.
Comment on lines
68
to
+72
| if ($updated_feed->getUpdateErrorCount() !== 0) { | ||
| $output->writeln($updated_feed->getLastUpdateError()); | ||
| $message = $updated_feed->getLastUpdateError(); | ||
| $message ??= 'Could not update feed with id ' . $feedId . ' for user ' . $userId; | ||
|
|
||
| $output->writeln($message); |
There was a problem hiding this comment.
Add/extend unit coverage for the new null-fallback path: when getUpdateErrorCount() != 0 and getLastUpdateError() returns null, this command should write the fallback message and return 255. There is already UpdateFeedTest::testValidFeedError covering the non-null case, but no test currently asserts the new behavior, so regressions could slip in unnoticed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A very modest check to ensure no crashing on nulls.
Checklist