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

fix: handle logbook room not found without throwing an error #1434

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

Junjiequan
Copy link
Member

Description

Added a check for !res.data in findByName to handle cases where the logbook is not found, preventing further processing on missing data.

Motivation

This ensures that if a logbook doesn’t exist, the function returns null gracefully, improving error handling and preventing potential issues when no data is returned.

Fixes:

Please provide a list of the fixes implemented by this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

@Junjiequan Junjiequan changed the title fix: handle logbook room not found without throwing an error. fix: handle logbook room not found without throwing an error Oct 3, 2024
@Junjiequan Junjiequan enabled auto-merge (squash) October 3, 2024 18:08
@Junjiequan Junjiequan merged commit 707e9e8 into master Oct 4, 2024
8 of 9 checks passed
@Junjiequan Junjiequan deleted the falsy-error-fix branch October 4, 2024 05:44
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