Fix logprobs menu on empty chats
| @@ -496,9 +496,13 @@ function getMessageHash(message) { | ||
| 496 | 496 | /** |
| 497 | 497 | * getActiveMessageLogprobData returns the logprobs data for the active chat |
| 498 | 498 | * message. |
| 499 | 499 | * @returns {MessageLogprobData || null} |
| 500 | 500 | */ |
| 501 | 501 | function getActiveMessageLogprobData() { |
| 502 | + if (chat.length === 0) { | |
| 503 | + return null; | |
| 504 | + } | |
| 505 | + | |
| 502 | 506 | const hash = getMessageHash(chat[chat.length - 1]); |
| 503 | 507 | return state.messageLogprobs.get(hash) || null; |
| 504 | 508 | } |