Changeset - r16579:63295fd2027c
[Not reviewed]
master
0 1 0
smatz - 14 years ago 2010-11-25 13:43:09
smatz@openttd.org
(svn r21319) -Fix: crash when creating file download by the content download system failed
1 file changed with 1 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/network/network_content.cpp
Show inline comments
 
@@ -476,14 +476,12 @@ bool ClientNetworkContentSocketHandler::
 
	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;
 
}
0 comments (0 inline, 0 general)