From b27116607fd1af6e44a95fe6d5d449d6b8506c52 Mon Sep 17 00:00:00 2001 From: dimitri Date: Tue, 26 Mar 2019 11:37:09 +0000 Subject: [PATCH] Fixed a crash in Mac Network when createConnection fails --- modules/juce_core/native/juce_mac_Network.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index 0730ba1201..ebba5b88d5 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -965,6 +965,9 @@ public: createConnection(); } + if (connection == nullptr) + return false; + if (! connection->start (owner, webInputListener)) { // Workaround for deployment targets below 10.10 where HTTPS POST requests with keep-alive fail with the NSURLErrorNetworkConnectionLost error code. @@ -980,7 +983,7 @@ public: return false; } - if (connection != nullptr && connection->headers != nil) + if (connection->headers != nil) { statusCode = connection->statusCode;