From 12e4075fad9e4ae2bfa08cb7fe11f66eb5b25992 Mon Sep 17 00:00:00 2001 From: Alex Castelan Date: Thu, 20 Aug 2026 15:49:49 -0700 Subject: [PATCH] Fix NullReferenceException on reconnect when connection error is null --- p4api.net/P4Server.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p4api.net/P4Server.cs b/p4api.net/P4Server.cs index 3c3b7a2..05e965c 100644 --- a/p4api.net/P4Server.cs +++ b/p4api.net/P4Server.cs @@ -737,8 +737,11 @@ public void Reconnect() if (pServer == IntPtr.Zero) { - ConnectionError = ConnectionErrorInt; + if (ConnectionError == null) + { + ConnectionError = new P4ClientError(ErrorSeverity.E_FATAL, string.Format("Unknown error reconnecting to server, {0}", _server)); + } P4Exception.Throw(ConnectionError); return; }