From e3a04dfa651ea4b32af64f207291ca8818adbf32 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 13 Feb 2017 23:31:16 +0000 Subject: [PATCH] Fix RegisterRestorer not handling potential throws on register assign This should fix part of #1214 --- src/commands.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 46f1e14b..65a0b752 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1510,8 +1510,15 @@ public: ~RegisterRestorer() { - if (m_name != 0) + if (m_name != 0) try + { RegisterManager::instance()[m_name] = m_save; + } + catch (runtime_error& e) + { + write_to_debug_buffer(format("Could not restore register '{}': {}", + m_name, e.what())); + } } private: