UnlimitedHugs/RimworldHugsLib

Error when Searching in Mod Options (1.4)

SaintBeef opened this issue · 19 comments

Error Message per Visual Exceptions:
Exception in Verse.Window.InnerWindowOnGUI: System.NullReferenceException: Object reference not set to an instance of an object at RimWorld.Dialog_Options.DoModOptions (Verse.Listing_Standard listing) [0x0008a] in <1ea541f48818430abd724fc665f76dc4>:0 - transpiler UnlimitedHugs.HugsLib: IEnumerable`1 HugsLib.Patches.DialogOptions_DoModOptions_Patch:InterceptWindowOpening(IEnumerable`1 instructions) at RimWorld.Dialog_Options.DoOptions (Verse.OptionCategoryDef category, UnityEngine.Rect inRect) [0x0011c] in <1ea541f48818430abd724fc665f76dc4>:0 at RimWorld.Dialog_Options.DoWindowContents (UnityEngine.Rect inRect) [0x000d5] in <1ea541f48818430abd724fc665f76dc4>:0 at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001fd] in <1ea541f48818430abd724fc665f76dc4>:0 - transpiler net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)

Error Message per Console Log:
Exception filling window for RimWorld.Dialog_Options: System.NullReferenceException: Object reference not set to an instance of an object at (wrapper dynamic-method) RimWorld.Dialog_Options.RimWorld.Dialog_Options.DoModOptions_Patch0(RimWorld.Dialog_Options,Verse.Listing_Standard) at RimWorld.Dialog_Options.DoOptions (Verse.OptionCategoryDef category, UnityEngine.Rect inRect) [0x0011c] in <1ea541f48818430abd724fc665f76dc4>:0 at RimWorld.Dialog_Options.DoWindowContents (UnityEngine.Rect inRect) [0x000d5] in <1ea541f48818430abd724fc665f76dc4>:0 at (wrapper dynamic-method) Verse.Window.Verse.Window.InnerWindowOnGUI_Patch0(Verse.Window,int) UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch4 (string) (wrapper dynamic-method) Verse.Window:Verse.Window.InnerWindowOnGUI_Patch0 (Verse.Window,int) UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

Steps to Reproduce:

  1. Enter Main Menu
  2. Go into Settings > Mod Settings
  3. Use the search bar, type in anything

ezgif com-gif-maker

Confirmed, looks like something introduced by a recent update.
Thanks for the report.

No problem. Thanks for the hard work!

Oh sweet you guys are already on top of it, should have suspected, keep it up!

This appears to still be an issue? Unsure if any information is needed but I've ran into this issue repeatedly, recently. Currently running with just Hugslib as the only mod installed and getting this exact error.

This appears to still be an issue? Unsure if any information is needed but I've ran into this issue repeatedly, recently. Currently running with just Hugslib as the only mod installed and getting this exact error.

Yes the mod author has unfortunately retired from hugslib, authors are now working to remove hugslib from their dependencies. Unless there is a third party fix this may just be a permanent issue

Where did they announce their retirement?

jeois commented

It doesn't really matter whether retirement was announced, the bottomline is this Mod Options Search field bug is still an issue despite several people giving pull requests that would fix it. Nobody is here to review and merge the fixes, so it stays stuck.

At a glance, this library project seems to have an open source license, so I wonder why anyone hasn't forked it after so many months. Putting out a temporary fork with patches seems like a lot less work than trying to remove it from being included in so many dependencies of mods.

jeois commented

I mean I'm sure many would love to, but are not coders

If nobody were coders, then there wouldn't be 2 pull requests which both tried to fix this issue already. You don't need to code to merge those pulls and fork this temporarily.
Somebody already did the coding 6 months ago, but nobody approved it. You can review PR #94 and #97 if you don't believe me.

I think you misunderstood the problem. It's less about coding and more just that modders are scared to collaborate because each modder is afraid about stepping on each other's toes because some mods have weird custom licenses. However, in the open source community, nobody cares about forks. Fortunately, this library's original author gave us permission, so there's no reason to be timid.

jeois commented

if you say so

if I'm wrong, there wouldn't be fixes already.

Has it been resolved? I am still encountering this error.

jeois commented

I don't get it. If your mod still relies on this lib, then there's no reason not to fork it and apply PR #74 or #79, so at least this mod option bug is fixed. It'd be one thing if nobody was interested at all, but 2 people already submitted patches. I suppose those other mods which depend on this are outdated too.

On the other hand, I think "Mod Options Sort" does make the error messages go away, so this issue has a workaround.

jeois commented

You misunderstood me again.
Firstly, if everyone already removed huglib as a dependency, we wouldn't need to discuss it, so that's a non sequitur and besides the point. Clearly, there are still mods which use this, and I'm suggesting they package a patched version with their mod. Sure, if they can replicate functions without this library, then of course that's also good, but in my opinion, that's more time consuming and probably why they haven't gotten around to doing it yet.

I don't worry about other breaks in the future because they'll happen regardless of whether we apply the patches or not. This thread isn't necessarily about potential issues down the line, which aren't contingent on the changes proposed anyway. Yes, the likelihood of something else breaking is high, but until other mod authors actually remove it or we stop using those mods, then we still have to deal with it for the time being.

In any case, I'm running half a dozen mods which use hugslib, and with Mod Options Sort, which fixes this issue, there hasn't been other issues so far. So when something does break, I'll worry about it then.

jeois commented

If you don't use it anymore, then of course you don't care. I'm just trying to help people with this issue. Pull Request #97 really does fix it, or you can use Mod Options Sort.

Should be resolved as part of the 1.5 update.