Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

rocketchat: Ignore missing rocketchat attachments.

Florian Pritz5ec8f4ef097a
diff --git a/zerver/data_import/rocketchat.py b/zerver/data_import/rocketchat.py
index 6bf3554b243..ff4ad7d6c63 100644
--- a/zerver/data_import/rocketchat.py
+++ b/zerver/data_import/rocketchat.py
@@ -366,6 +366,10 @@ def process_message_attachment(
upload_id_to_upload_data_map: Dict[str, Dict[str, Any]],
output_dir: str,
) -> Tuple[str, bool]:
+ if upload["_id"] not in upload_id_to_upload_data_map: # nocoverage
+ logging.info("Skipping unknown attachment of message_id: %s", message_id)
+ return "", False
+
upload_file_data = upload_id_to_upload_data_map[upload["_id"]]
file_name = upload["name"]
file_ext = f'.{upload["type"].split("/")[-1]}'