[qw] Check for null file before checking size

Fixes a segfault when downloading a file that doesn't exist.
This commit is contained in:
Bill Currie 2021-07-22 18:02:36 +09:00
parent e089234f38
commit b3e7b52696

View file

@ -758,7 +758,7 @@ SV_BeginDownload_f (void *unused)
file = _QFS_FOpenFile (name, !zip); file = _QFS_FOpenFile (name, !zip);
host_client->download = file; host_client->download = file;
host_client->downloadsize = Qfilesize (file); host_client->downloadsize = file ? Qfilesize (file) : 0;
host_client->downloadcount = 0; host_client->downloadcount = 0;
if (!host_client->download if (!host_client->download