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

🐛 Refactor: Fix file path access to prevent error #966

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

ShanaLMoore
Copy link
Contributor

@ShanaLMoore ShanaLMoore commented Aug 2, 2024

Summary

When testing the OAI importer on Adventist valkyrie, we received the following error. The error was caused because oai imports from a feed, so no original file exists. When checking, instead of returning false it returned nil, and thus caused a TypeError.

related:

Screenshots / Video

BEFORE

Screenshot 2024-08-02 at 14-37-00 Action Controller Exception caught

AFTER

image

Expected Behavior

The site will not break when an original file doesn't exist.

Notes

🐛 Refactor: Fix file path access to prevent error

970ad45

  • Centralized the import_file_path logic into a separate method
  • Resolved TypeError caused by nil values when checking file existence
  • Improved code readability and maintainability

- Centralized the import_file_path logic into a separate method
- Resolved TypeError caused by nil values when checking file existence
- Improved code readability and maintainability
@ShanaLMoore ShanaLMoore merged commit fe15dde into main Aug 2, 2024
6 of 7 checks passed
@ShanaLMoore ShanaLMoore deleted the refactor-original-file-method branch August 2, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-ver for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants