Fixed a possible NPE when the OS was not able to determine a file's mime type. We need to write a FileTypeDetector or try another methods to detect the MIME types, because MACs can't even detect css.