mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Check if n is populated before making a comparison
This commit is contained in:
@@ -110,6 +110,7 @@ def chat_history(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if n:
|
||||||
# Get latest N messages if N > 0
|
# Get latest N messages if N > 0
|
||||||
if n > 0 and meta_log.get("chat"):
|
if n > 0 and meta_log.get("chat"):
|
||||||
meta_log["chat"] = meta_log["chat"][-n:]
|
meta_log["chat"] = meta_log["chat"][-n:]
|
||||||
|
|||||||
Reference in New Issue
Block a user