Ensure no blank character name/output file

This commit is contained in:
erew123 authored and GitHub committed 2025-01-26 00:36:27 +00:00
1 parent 8f5bb216a6
commit f8fe5ce167
1 file changed
+3 -4
+3 -4
View File
@@ -763,11 +763,10 @@ def output_modifier(string, state):
# Lock and process TTS request
if process_lock.acquire(blocking=False):
try:
output_file = (
state["character_menu"] if "character_menu" in state else str("TTSOUT_")
)
output_file = (state["character_menu"] if "character_menu" in state else str("TTSOUT_"))
output_file = (state["character_menu"] if "character_menu" in state and state["character_menu"] is not None else "TTSOUT_")
# Ensure the file name matches the allowed pattern of AllTalk
output_file = re.sub(r"[^a-zA-Z0-9_]", "", output_file)
output_file = re.sub(r"[^a-zA-Z0-9_]", "", output_file) or "TTSOUT_" # Fallback if empty
generate_response, status_message = send_and_generate(
cleaned_text,