Skip to content
Snippets Groups Projects
Commit 40aba5bd authored by Philipp Hörist's avatar Philipp Hörist
Browse files

cfix: ArchiveStorage: Don’t fail there is no message found

Fixes #11817
parent 5f12092a
No related branches found
No related tags found
No related merge requests found
......@@ -327,10 +327,11 @@ class MessageArchiveStorage(AlchemyStorage):
)
result = session.scalars(stmt).all()
if len(result) > 1:
self._log.warning('Found >1 message with message id %s', message_id)
return None
return result[0]
if len(result) == 1:
return result[0]
self._log.warning('Found more than one message with message id %s', message_id)
return None
@with_session
@timeit
......@@ -352,10 +353,11 @@ class MessageArchiveStorage(AlchemyStorage):
)
result = session.scalars(stmt).all()
if len(result) > 1:
self._log.warning('Found >1 message with stanza id %s', stanza_id)
return None
return result[0]
if len(result) == 1:
return result[0]
self._log.warning('Found more than one message with stanza id %s', stanza_id)
return None
@with_session
@timeit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment