fix: return empty list on ValueError in _get_commands_list_from_settings#2275
Open
wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
Open
fix: return empty list on ValueError in _get_commands_list_from_settings#2275wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
wishhyt wants to merge 1 commit intoqodo-ai:mainfrom
Conversation
When `get_settings().get()` raises ValueError, the except block logs the error but has no return statement, causing the function to implicitly return None. Callers use `.extend()` on the result, which raises TypeError on None. Return an empty list instead. Made-with: Cursor
Contributor
Review Summary by QodoFix missing return statement in _get_commands_list_from_settings
WalkthroughsDescription• Fix missing return statement in exception handler • Prevents TypeError when settings retrieval fails • Allows webhook processing to continue gracefully • Minor formatting improvement to function signature Diagramflowchart LR
A["_get_commands_list_from_settings called"] --> B{"get_settings().get() succeeds?"}
B -->|Yes| C["Return command list"]
B -->|No ValueError| D["Log error"]
D --> E["Return empty list"]
C --> F["Caller uses .extend()"]
E --> F
File Changes1. pr_agent/servers/bitbucket_server_webhook.py
|
Contributor
Code Review by Qodo
1. No tests for new return []
|
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
Changes
pr_agent/servers/bitbucket_server_webhook.py: Added return [] to the except ValueError block
Test plan