Check for nil parameters before attempting to download a file