diff --git a/dff/pipeline/pipeline/pipeline.py b/dff/pipeline/pipeline/pipeline.py index c65ac9e7a..49864f7d1 100644 --- a/dff/pipeline/pipeline/pipeline.py +++ b/dff/pipeline/pipeline/pipeline.py @@ -322,7 +322,9 @@ async def _run_pipeline(self, request: Message, ctx_id: Optional[Hashable] = Non :param ctx_id: Current dialog id; if `None`, new dialog will be created. :return: Dialog `Context`. """ - if isinstance(self.context_storage, DBContextStorage): + if ctx_id is None: + ctx = Context() + elif isinstance(self.context_storage, DBContextStorage): ctx = await self.context_storage.get_async(ctx_id, Context(id=ctx_id)) else: ctx = self.context_storage.get(ctx_id, Context(id=ctx_id))