View Full Version : Error When Setting Category [attempt to index global 'category' (a nil value)]
seansps
November 17th, 2022, 18:01
I am seeing an error in one of my development campaigns when I am trying to set records to a new category I created. This is in the latest version of FG (4.3.1). I have been unable to recreate the issue in other campaigns, so I am wondering what could cause this. Is this due to some sort of data corruption? The error pops up below when clicking and dragging certain records (like NPCs) to a new Category. The weird thing is that the category does seem to get set, it just pops this in the console:
[11/17/2022 12:51:11 PM] [ERROR] Handler error: [string "CoreRPG:..cripts/masterindexitem_window.lua"]:132: attempt to index global 'category' (a nil value)
stack traceback:
[string "CoreRPG:..cripts/masterindexitem_window.lua"]:132: in function <[string "CoreRPG:..cripts/masterindexitem_window.lua"]:127>
[C]: in function 'setCategory'
[string "CoreRPG:..ts/masterindexcategory_window.lua"]:15: in function 'handleDrop'
[string "CoreRPG:..pts/masterindexcategory_label.lua"]:33: in function <[string "CoreRPG:..pts/masterindexcategory_label.lua"]:32>
Moon Wizard
November 17th, 2022, 19:52
From the error message, it looks like it is unable to find the category control.
Just some random questions/thoughts to explore further:
* Have you modified the masterindexitem windowclass at all? Or any of the window classes or scripts used in the master index implementation?
* Do you have a filter named "category" for that list?
Regards,
JPG
seansps
November 17th, 2022, 21:03
From the error message, it looks like it is unable to find the category control.
Just some random questions/thoughts to explore further:
* Have you modified the masterindexitem windowclass at all? Or any of the window classes or scripts used in the master index implementation?
* Do you have a filter named "category" for that list?
Regards,
JPG
Thanks for the reply Moon! It doesn't look like I altered any masterindexitem windowclasses at all... no filter named category, but I did just add one named "Price Category." Could that be conflicting?
Moon Wizard
November 17th, 2022, 21:07
No idea, without having the ruleset and the example campaign to set up debug statements. Or you can do that using unpacked CoreRPG on your end too.
The error message is just stating that the "category" variable is currently nil; which shouldn't happen because the "masterindexitem" window class specifically defines a "category" control.
Regards,
JPG
seansps
November 17th, 2022, 21:38
No idea, without having the ruleset and the example campaign to set up debug statements. Or you can do that using unpacked CoreRPG on your end too.
The error message is just stating that the "category" variable is currently nil; which shouldn't happen because the "masterindexitem" window class specifically defines a "category" control.
Regards,
JPG
Right- well it's especially weird because it doesn't happen in ALL my campaigns, just this one I am using for development! And I checked, I am not overriding that, or the category control... I'll keep poking around though!
seansps
November 17th, 2022, 22:03
Okay I found the bug. It's in fact happening in all rulesets.
Here's the steps to recreate:
1. In any campaign (say 5e) load a module that is readonly like the Monster manual
2. Open the NPCs window
3. Create a new category
4. Select the category that contains the NPCs in the monster manual
5. Click and drag to copy an NPC
6. With this current category STILL selected, click and drag the (Copy) NPC to the new category
7. Error pops up
tjlee
November 18th, 2022, 22:10
Hi, I'm also seeing the same error and I've reproduced it as follows:
1) Create new 5e campaign without loading any extensions
2) Don't load any modules
3) Go to items, create a new group (use the default "Group 1")
4) Create a new item (call is "1") and move it from "Uncategorized" to "Group 1" or vice versa - the error message appears.
5) Quit and restart, moving the previously saved item no longer displays the error message, however, creating a new item and moving it to a different group reproduces the error.
Please fix?
Moon Wizard
November 22nd, 2022, 18:46
Thanks guys. I was able to recreate with @seansps steps, but not others. I'll be working on a fix.
Regards,
JPG
raif11152
January 1st, 2023, 03:53
Thanks guys. I was able to recreate with @seansps steps, but not others. I'll be working on a fix.
Regards,
JPG
Any update on this? Its kinda maddening. :)
Moon Wizard
January 1st, 2023, 07:35
It's in the pipeline with other changes. I'll be having a beta soon with a bunch of updates.
Regards,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.