From ceaac96ac8c3be968b85dc2499e6ac048b42c383 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Sun, 11 Aug 2024 02:31:01 -0400 Subject: [PATCH] [rtns] Fix crash when ssh error occurs during refresh (#6936) --- roborioteamnumbersetter/src/main/native/cpp/App.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/roborioteamnumbersetter/src/main/native/cpp/App.cpp b/roborioteamnumbersetter/src/main/native/cpp/App.cpp index d961fae5ef..48677f4c0d 100644 --- a/roborioteamnumbersetter/src/main/native/cpp/App.cpp +++ b/roborioteamnumbersetter/src/main/native/cpp/App.cpp @@ -235,7 +235,14 @@ static void DisplayGui() { ImGui::Text("Refreshing Status"); const auto fs = futureStatus->wait_for(std::chrono::seconds(0)); if (fs == std::future_status::ready) { - deviceStatuses[i.first] = futureStatus->get(); + // DeploySession may throw exceptions. They've already been logged, so + // we can ignore them. + try { + deviceStatuses[i.first] = futureStatus->get(); + } catch (const std::exception&) { + // pass, already been logged + } + // Always destroy the future so the UI updates deploySession.DestroyStatusFuture(i.first); } } else {