From bd1cbe1b64008da9280d72c77e943ede9108a354 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 21 Feb 2020 08:02:47 -0800 Subject: [PATCH] client Context safety --- src/client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index fba7a67..e169be2 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -134,11 +134,17 @@ Context::~Context() {} const Config& Context::config() const { + if(!pvt) + throw std::logic_error("NULL Context"); + return pvt->effective; } void Context::hurryUp() { + if(!pvt) + throw std::logic_error("NULL Context"); + pvt->tcp_loop.call([this](){ pvt->poke(); });