Fixed a crash bug

The server doesn't send the type of the file yet.
Therefore, we cannot yet read the type of the file.