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.")