Skip to content
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

BUG: Avoid str concat with None when logging user_intent #51

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

serhatgktp
Copy link
Contributor

The following two lines occasionally crash the program:

user_intent = get_first_nonempty_line(result)
log.info("Canonical form for user intent: " + user_intent)

because user_intent may be equal to None. This is also seemingly expected as the very next line of code checks for it.

if user_intent is None:
    ...

Thus it should make sense to alter the logging line to prevent the program from crashing, as follows:

log.info("Canonical form for user intent: " + (user_intent if user_intent else "None"))

Signed-off-by: serhatgktp <efkan@ibm.com>
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