sn4k3 / UVtools

MSLA/DLP, file analysis, calibration, repair, conversion and manipulation
GNU Affero General Public License v3.0
1.15k stars 103 forks source link

System.NullReferenceException when stack importing layers since the 4.2.0 update #835

Closed Darantius closed 5 months ago

Darantius commented 5 months ago

System

UVtools v4.2.0 X64
Operative system: Microsoft Windows 10.0.19045 X64
Processor: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
Processor cores: 4
Memory RAM: 6.86 / 15.93 GB
Runtime: win10-x64
Framework: .NET 6.0.26
AvaloniaUI: 11.0.7
OpenCV: 4.8.1

Path:       C:\Program Files\UVtools\
Executable: C:\Program Files\UVtools\UVtools.exe
Loaded file: PRINT 102% Metal floor arrow tip maghex.pwmx [Version: 1] [Class: PhotonWorkshopFile]

Printer and Slicer

Description of the bug

Since the most recent update, importing layers using the 'stack' method (to add an existing model next to another) often generates this error:

System.NullReferenceException: Object reference not set to an instance of an object. at UVtools.Core.Operations.OperationLayerImport.<>cDisplayClass61_5.b4(Int64 i) in UVtools.Core\Operations\OperationLayerImport.cs:line 518 at System.Threading.Tasks.Parallel.<>cDisplayClass20_0`1.b1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass20_0`1.b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute()

How to reproduce

  1. Open sliced object 'A' in UVtools, detect issues and resolve, save file, close
  2. Open sliced object 'B' in UVtools, detect issues and resolve, save file
  3. Use import layers function with 'stack' method to try to add save object A next to B (or other way around) to be printed together.
  4. Error returned after import calculation. Object not added

I've attached two files as an example which most recently caused this issue. Have seen the issue with many other files however.

Files

Import bug example files.zip UVtools_mRWtPafUJp UVtools_y34kzUmgkX

github-actions[bot] commented 5 months ago

This is your first time submitting an issue with UVtools 🥳Please review your issue and ensure that the submit template was followed, the information is complete, and not related to any other open issue. It will be reviewed shortly. Debugging is very important and make the program better. Thanks for contributing and making the software better! 🙌

sn4k3 commented 5 months ago

Fixed