From fa75fb40beaf5bfb5992368b663d86fdcfe2c93a Mon Sep 17 00:00:00 2001
From: Eli Hughes <ehughes@wavenumber.net>
Date: Sat, 15 Feb 2025 19:32:21 +0000
Subject: [PATCH] Fix crash in HTTP libraries if server doesn't return a
 description

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19963
---
 include/http_lib/http_lib_connection.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/http_lib/http_lib_connection.h b/include/http_lib/http_lib_connection.h
index da1e17bd24..96f9ce5109 100644
--- a/include/http_lib/http_lib_connection.h
+++ b/include/http_lib/http_lib_connection.h
@@ -65,7 +65,10 @@ public:
 
     std::string getCategoryDescription( const std::string& aCategoryName ) const
     {
-        return m_categoryDescriptions.at( aCategoryName );
+        if( m_categoryDescriptions.contains( aCategoryName ) )
+           return m_categoryDescriptions.at( aCategoryName );
+        else
+           return "";
     }
 
     auto& getCachedParts() { return m_cache; }