From 7bfb1ef12e482ecfb30a9648cbac0461c0cbd474 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Wed, 28 Feb 2024 11:51:02 -0500
Subject: [PATCH] Guard against answer() being called before the first channel
 is created.

In this case, just accept whatever we get info on as the "first" one.

Likely fixes #728
---
 src/sbbs3/answer.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/sbbs3/answer.cpp b/src/sbbs3/answer.cpp
index c822ed7925..fa548171af 100644
--- a/src/sbbs3/answer.cpp
+++ b/src/sbbs3/answer.cpp
@@ -446,6 +446,8 @@ bool sbbs_t::answer()
 					}
 					if (cryptStatusOK(i)) {
 						i=cryptGetAttribute(ssh_session, CRYPT_SESSINFO_SSH_CHANNEL, &ccid);
+						if (cid == -1)
+							cid = ccid;
 						if (cryptStatusOK(i) && ccid != cid)
 							continue;
 					}
-- 
GitLab