Skip to content

chore: fix unsafe access to result[1].msgs #417

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zkpepe
Copy link

@zkpepe zkpepe commented Mar 26, 2025

Fixed an issue in run_society_with_strict_limit where result[1].msgs could cause errors if the structure wasn't as expected. Now the checks are more robust, ensuring safe access to msgs.

if len(result) >= 2 and hasattr(result[1], 'msgs') and result[1].msgs and len(result[1].msgs) > 0:
if len(result) >= 2 and hasattr(result[1], 'msgs') and result[1].msgs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @zkpepe for the PR, I don't understand why we remove len(result[1].msgs) > 0 check here and how could it improve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants