Prevent unhandled exception when upload file has no extension

Was getting a NullPointerException when filename contains no '.' character.