TorchAPI / Torch

An extensible modding framework and improved client/DS for Space Engineers. Still a work in progress!
Apache License 2.0
146 stars 76 forks source link

Reorganizing the mods list crashes the server wrapper while in themed mode. #364

Closed thakyZ closed 4 years ago

thakyZ commented 4 years ago

Torch Version: 1.3.1.100 SE Version: 1.19.3.103 (Experimental Mode)

Expected Behavior

You can drag and drop the mods in the mod list up or down freely no matter the theme.

Observed Behavior

When dragging a mod downward in the list it crashes while in a theme other than Torch Theme. Although when dragging a mod upward in the list it works just fine.

Steps to Reproduce

  1. Start with a fresh install
  2. Set the theme to Light Theme or Dark Theme and it can be the animated ones.
  3. Add at least two mods in the mods list if not added already
  4. Drag a mod upward in the list (It shouldn't crash)
  5. Drag a mod downward in the list.
  6. Crash
  7. Repeat steps 4 5 with the Torch theme, and it should work fine.

Other Information

I did some debugging with commit 5035fa3 and I have found that when dragging upward the values for the parameter values of the function Torch.Server.Views.Converters.ModToListIdConverter.Convert(object[] values, Type targetType, object parameter, CultureInfo culture) the array has two indexes (0 and 1) and they are correct and correspond to the objects that the function tries to cast them as, and when dragging downward the two indexes are not correctly cast as they do not have the correct data to cast, the data that is in both of them is _name as a key, and undefined as a value.

Here is a log file of the crash https://pastebin.com/arvK5y8g

thakyZ commented 4 years ago

wokka had noted that:

I remember early on trying to use themes and not sure what wasn't working right, but abandoned it pretty quickly. I wouldn't be surprised if they just abandon the themes

EDIT: removed the tag so this person doesn't get pinged