diff options
author | smatz <smatz@openttd.org> | 2010-11-25 13:43:09 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2010-11-25 13:43:09 +0000 |
commit | 9594a3f7c55d62600e7179f3dd449ec041d2f96f (patch) | |
tree | e20136957d027eda094c81a7192783aa242653b0 | |
parent | eb4516e50c6a50ed5970f4cbcf2daa463252d204 (diff) | |
download | openttd-9594a3f7c55d62600e7179f3dd449ec041d2f96f.tar.xz |
(svn r21319) -Fix: crash when creating file download by the content download system failed
-rw-r--r-- | src/network/network_content.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 8d98dc184..ad59c6e51 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -476,14 +476,12 @@ bool ClientNetworkContentSocketHandler::BeforeDownload() if (this->curInfo->filesize != 0) { /* The filesize is > 0, so we are going to download it */ const char *filename = GetFullFilename(this->curInfo, true); - if (filename == NULL) { + if (filename == NULL || (this->curFile = fopen(filename, "wb")) == NULL) { /* Unless that fails ofcourse... */ DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0); ShowErrorMessage(STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD, STR_CONTENT_ERROR_COULD_NOT_DOWNLOAD_FILE_NOT_WRITABLE, WL_ERROR); return false; } - - this->curFile = fopen(filename, "wb"); } return true; } |