Not a good place to put an assert since that will make the client crash on receiving an invalid file.