Fix potential for invalid sorting of uploads
Fix potential for invalid sorting of uploads

"date" and "size" might be undefined on both parameters (e.g. for
folders, SD files). We have no guarantee that "a" will always have
either defined, so make sure to test or a wrong sorting order might be
the consequence.

Fixes #2355

foosel/OctoPrint,Jaesin/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,Jaesin/OctoPrint,Jaesin/OctoPrint,Jaesin/OctoPrint