From c1f94fd0bde8218c6ca00fff74aa5d1b8f6d64ad Mon Sep 17 00:00:00 2001 From: martinRenou Date: Tue, 19 Dec 2023 23:41:41 +0100 Subject: [PATCH] Fix for last_modified being None (#223) --- jupyter_collaboration/rooms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jupyter_collaboration/rooms.py b/jupyter_collaboration/rooms.py index 32657a6e..38823769 100644 --- a/jupyter_collaboration/rooms.py +++ b/jupyter_collaboration/rooms.py @@ -187,7 +187,9 @@ async def _on_content_change(self, event: str, args: dict[str, Any]) -> None: event (str): Type of change. args (dict): A dictionary with format, type, last_modified. """ - if event == "metadata" and self._last_modified < args["last_modified"]: + if event == "metadata" and ( + self._last_modified is None or self._last_modified < args["last_modified"] + ): self.log.info("Out-of-band changes. Overwriting the content in room %s", self._room_id) self._emit(LogLevel.INFO, "overwrite", "Out-of-band changes. Overwriting the room.")