Fix compile when upload was None

Introduced in 75c2d03267234398760495ed189cb19ebba9200c