nesrak1 / UABEA

c# uabe for newer versions of unity
MIT License
1.21k stars 153 forks source link

Copy & Paste long text on Edit Data crashes #380

Open Hexaae opened 1 month ago

Hexaae commented 1 month ago

Describe the bug Copy & Paste causes crashes on a .bundle extracted in memory (CAB-xxxxxxxxxxxxxxxxxxxx), if you Edit Data

To Reproduce

  1. Open a .bundle
  2. Click "Info"
  3. Select a Monobheaviour file
  4. Click "Edit Data" button (will warn the file is huge)
  5. Copy & Paste edited text into the Edit Data window (I edit the text with an external editor like 010 Editor or Cudatext...)
  6. Save clicking "Ok"
  7. "Save As..." the .bundle
  8. repeat from point 2 to 5 (paste the changed text again)

At this point, right after paste, UABEA will crash with this error:

System.NullReferenceException: Object reference not set to an instance of an object.
   at TextMateSharp.Model.TMModel.InvalidateLine(Int32 lineIndex) in /_/src/TextMateSharp/Model/TMModel.cs:line 429
   at TextMateSharp.Model.TMModel.TokenizerThread.ThreadWorker(Object state) in /_/src/TextMateSharp/Model/TMModel.cs:line 109
   at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

Expected behavior Nothing. Eeverything should go on as expected... It crashes instead.

Screenshots image

Additional context

nesrak1 commented 1 month ago

Bug exists in the latest version of TextMateSharp. I'll report the bug to that repo later.