Add path validation, fix silent folder fallthrough and move traceback import in app.py#40
Open
agentksimha wants to merge 2 commits intohumanai-foundation:mainfrom
Open
Add path validation, fix silent folder fallthrough and move traceback import in app.py#40agentksimha wants to merge 2 commits intohumanai-foundation:mainfrom
agentksimha wants to merge 2 commits intohumanai-foundation:mainfrom
Conversation
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.
Changes made to ISSR_Communication_Analysis_Tool_Samuel_Kalu/app.py:
Added path validation in get_image_base64
The function opened the file directly with no existence check. A missing asset throws a generic FileNotFoundError with no context about which asset was missing. Added an explicit check that raises FileNotFoundError with the exact path.
Fixed silent folder path fallthrough in process_multiple_videos
When folder_path is provided but is not a valid directory, the original code silently falls through to the elif video_files branch with no feedback to the user. Added an explicit elif folder_path and not os.path.isdir(folder_path) branch that returns a clear error message to the user immediately.
Added logo asset validation in create_interface
get_image_base64 was called with a hardcoded relative path with no existence check. If the assets folder is missing the entire interface crashes at startup. Added a check that logs a warning and renders the interface without the logo rather than crashing.
Moved traceback import to module level
import traceback appeared twice inside except blocks. Importing inside exception handlers works but is bad practice and adds overhead every time the exception is triggered. Moved to the top of the file with the other imports.