Add a null-pointer check to update checker. Updates #1164.

Originally committed to SVN as r4383.
This commit is contained in:
Niels Martin Hansen 2010-06-01 02:08:22 +00:00
parent db3c67cfaf
commit 0fe2071082
1 changed files with 2 additions and 0 deletions

View File

@ -343,6 +343,8 @@ void AegisubVersionCheckerThread::DoCheck()
throw VersionCheckError(STD_STR(_("Could not connect to updates server.")));
std::auto_ptr<wxInputStream> 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()));