From 2662b06099690d524b6335af1e664d3cd7b0d610 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 9 Mar 2020 14:05:34 -0400 Subject: [PATCH] Handle exception when JSON datatype mismatches Fixes #4031 --- include/settings/json_settings.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/settings/json_settings.h b/include/settings/json_settings.h index 7a54d7dadf..45b4b4a39a 100644 --- a/include/settings/json_settings.h +++ b/include/settings/json_settings.h @@ -105,7 +105,15 @@ public: OPT Get( std::string aPath ) const { if( OPT ret = GetJson( std::move( aPath ) ) ) - return ret->get(); + { + try + { + return ret->get(); + } + catch( ... ) + { + } + } return NULLOPT; }