Editor Category Selection Not Working When Null

desukarhu

Member
Hi,

As I mentioned on discord it seems that category attribute selection broke in some recent update for me.

I have skills that have a "Weapon Requirement" attribute and it's just a category attribute. If I create a new ItemDefinition and go to change it's weapon requirement the attribute just says "NULL" with no way to click it/interact with it.
notworkingcategoryselection.png

If I go look at some of my older skills where I already have set the weapon requirement the category selection works fine. But if I set the weapon requirement back to "None", click on some other item briefly and then go back to the skill the category selection says the same "NULL" again.
Here's a video of me nullifying a category attribute and it breaking: https://streamable.com/r5dgrr
workingcategoryselect.png

I'm using Unity 2021.3.16f1 and UIS 1.2.12.
 
Last edited:
Thank you for bringing this to my attention.
There indeed is a bug. It was caused by a change I made that I wasn't 100% sure about.

Find the ControlWithInventoryDatabase script and comment out the value null check around line 54

Code:
 //TODO this used to be field == null, but it was limiting bindings, so I changed it to value ==null, please double check there aren't any issues
 //TODO There is an issue because null Scriptable objects appeared as "NULL" instead of a field, so Completely commenting out that part
 /*if (value == null) {
     var text = value == null ? "NULL" : value.ToString();
     container.Add(new Label(text));
     return container;
 }*/

I checked all the types it is affecting and it should be fine, but just in case something is wrong please make sure to let me know
 
Thank you for bringing this to my attention.
There indeed is a bug. It was caused by a change I made that I wasn't 100% sure about.

Find the ControlWithInventoryDatabase script and comment out the value null check around line 54

Code:
 //TODO this used to be field == null, but it was limiting bindings, so I changed it to value ==null, please double check there aren't any issues
 //TODO There is an issue because null Scriptable objects appeared as "NULL" instead of a field, so Completely commenting out that part
 /*if (value == null) {
     var text = value == null ? "NULL" : value.ToString();
     container.Add(new Label(text));
     return container;
 }*/

I checked all the types it is affecting and it should be fine, but just in case something is wrong please make sure to let me know
Thanks! Seems to work nicely. I'll reply to this thread if any issues come up regarding this, but I didn't notice any so far.
 
Top