Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

1M Downloads

Crashes when inputting an illegal character on save/rename

CreepahJacket opened this issue ยท 3 comments

commented

Issue

Game instantly crashes when inputting an illegal character (/ ? < > \ : * | ") on save/rename

How to replicate

  1. After recording a replay file, input an illegal character in the name.
  2. Hit save.

Alternatively,

  1. Go to the replay menu
  2. Try to rename a replay file with an illegal character.

What I expected

The mod does not allow you to input illegal characters when renaming/saving a file.

Crash Report

The game crashed whilst chartyped event handler
Error: java.nio.file.InvalidPathException: Illegal char <<> at index 19: 2022_03_30_15_16_08<.mcpr
Exit Code: -1

crash-2022-03-30_19.20.01-client.txt

commented

Cannot reproduce:

commented

huh, odd. i've updated the issue to include the crash report, though i'm guessing that it's something to do with the platform i'm on, since windows has a thing with illegal characters

commented

Ah, yes, that'll be it. On Windows it errors as soon as the Path is put together, on Linux it only errors if you try to access it, and I'm only handling the latter one.
Edit: Not directly related, but I also just realized that I need to filter out the path separator (/ or \) so it doesn't create folders.