From 0fe2071082f774bf3a8c1bc3381c5533f5069210 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Tue, 1 Jun 2010 02:08:22 +0000 Subject: [PATCH] Add a null-pointer check to update checker. Updates #1164. Originally committed to SVN as r4383. --- aegisub/src/dialog_version_check.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aegisub/src/dialog_version_check.cpp b/aegisub/src/dialog_version_check.cpp index f32af9780..6bc979fb5 100644 --- a/aegisub/src/dialog_version_check.cpp +++ b/aegisub/src/dialog_version_check.cpp @@ -343,6 +343,8 @@ void AegisubVersionCheckerThread::DoCheck() throw VersionCheckError(STD_STR(_("Could not connect to updates server."))); std::auto_ptr stream(http.GetInputStream(path)); + if (stream.get() == 0) // check for null-pointer + throw VersionCheckError(_("Could not connect to updates server.")); if (http.GetResponse() < 200 || http.GetResponse() >= 300) { const std::string str_err = STD_STR(wxString::Format(_("HTTP request failed, got HTTP response %d."), http.GetResponse()));