diff --git a/cscore/src/main/native/cpp/MjpegServerImpl.cpp b/cscore/src/main/native/cpp/MjpegServerImpl.cpp index 9dd6f33c7d..f548f9c61a 100644 --- a/cscore/src/main/native/cpp/MjpegServerImpl.cpp +++ b/cscore/src/main/native/cpp/MjpegServerImpl.cpp @@ -111,13 +111,13 @@ class MjpegServerImpl::ConnThread : public wpi::SafeThread { void StartStream() { std::lock_guard lock(m_mutex); - m_source->EnableSink(); + if (m_source) m_source->EnableSink(); m_streaming = true; } void StopStream() { std::lock_guard lock(m_mutex); - m_source->DisableSink(); + if (m_source) m_source->DisableSink(); m_streaming = false; } };