From 8a507b0a0b0f5fe717906d1aabe85eafcbad39d7 Mon Sep 17 00:00:00 2001 From: tek Date: Thu, 13 Apr 2023 09:26:52 +0200 Subject: [PATCH] Fixes a bug in WhatsApp iOS module --- mvt/common/module.py | 3 +++ mvt/ios/modules/mixed/whatsapp.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mvt/common/module.py b/mvt/common/module.py index 2fff891..b6d4a70 100644 --- a/mvt/common/module.py +++ b/mvt/common/module.py @@ -198,6 +198,9 @@ def run_module(module: MVTModule) -> None: module.to_timeline() except NotImplementedError: pass + except Exception as exc: + module.log.exception("Error when serializing data from module %s: %s", + module.__class__.__name__, exc) module.save_to_json() diff --git a/mvt/ios/modules/mixed/whatsapp.py b/mvt/ios/modules/mixed/whatsapp.py index 3458c6a..6ef644e 100644 --- a/mvt/ios/modules/mixed/whatsapp.py +++ b/mvt/ios/modules/mixed/whatsapp.py @@ -38,7 +38,7 @@ class Whatsapp(IOSExtraction): def serialize(self, record: dict) -> Union[dict, list]: text = record.get("ZTEXT", "").replace("\n", "\\n") links_text = "" - if record["links"]: + if record.get("links"): links_text = " - Embedded links: " + ", ".join(record["links"]) return {