From b1357cace779a9e8e51467eb777400d9ec41fb6b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 16 Jan 2020 00:34:51 -0800 Subject: [PATCH] Fix LiveWindow SetEnabled C++ std::bad_function_call (#2281) It was missing a null check. --- wpilibc/src/main/native/cpp/livewindow/LiveWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpilibc/src/main/native/cpp/livewindow/LiveWindow.cpp b/wpilibc/src/main/native/cpp/livewindow/LiveWindow.cpp index 9e624cbbcb4..517ecf7d23b 100644 --- a/wpilibc/src/main/native/cpp/livewindow/LiveWindow.cpp +++ b/wpilibc/src/main/native/cpp/livewindow/LiveWindow.cpp @@ -104,12 +104,12 @@ void LiveWindow::SetEnabled(bool enabled) { // Force table generation now to make sure everything is defined UpdateValuesUnsafe(); if (enabled) { - this->enabled(); + if (this->enabled) this->enabled(); } else { m_impl->registry.ForeachLiveWindow(m_impl->dataHandle, [&](auto& cbdata) { cbdata.builder.StopLiveWindowMode(); }); - this->disabled(); + if (this->disabled) this->disabled(); } m_impl->enabledEntry.SetBoolean(enabled); }