From: Michael Friedrich Date: Wed, 21 Mar 2018 19:41:52 +0000 (+0100) Subject: Fix crash without CORS config settings X-Git-Tag: v2.9.0~120^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b11ab95f41deefbf70087d5c05fd75169a055358;p=icinga2 Fix crash without CORS config settings fixes #6173 refs #6098 --- diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index 1592e3839..6e8ea1c58 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -214,7 +214,7 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response) Array::Ptr headerAllowOrigin = listener->GetAccessControlAllowOrigin(); - if (headerAllowOrigin->GetLength() != 0) { + if (headerAllowOrigin && headerAllowOrigin->GetLength() != 0) { String origin = m_CurrentRequest.Headers->Get("origin"); { ObjectLock olock(headerAllowOrigin);