Check if serial was parsed correctly to prevent null pointer dereference; index.txt is potentially untrusted.