StringTable.GetEntry(entry) is returning null after upgrading to 0.8.1

I was using 0.7.1 without issues, and I updated to 0.8.1 today and I’m now getting this error:

NullReferenceException: Object reference not set to an instance of an object
Nodeshifter.LocalizationHelper.getStringEntry (System.String entry) (at Assets/Scripts/Nodeshifter/LocalizationHelper.cs:70)
OverlayEquipCassettes+<Setup>d__13.MoveNext () (at Assets/Scripts/OverlayEquipCassettes.cs:95)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
UnityEditor.PlayModeView:RenderView(Vector2, Boolean)
Unity.DeviceSimulator.SimulatorWindow:OnGUI() (at Library/PackageCache/com.unity.device-simulator@2.2.3-preview/Editor/SimulatorWindow.cs:134)

When calling this:

        public string getStringEntry(string entry)
        {
            if (dbStrings == null) return "NOT_READY";
            return dbStrings.GetEntry(entry).LocalizedValue;
        }

dbStrings is a StringTable and is correctly showing values when debugging (check attachment)

Did something change that would break this?

Nothing changed that should break things.
Is this in the editor or player?
Can you please file a bug report?
Is the value being passed into GetEntry correct? Did it maybe change?

1 Like

It was my own mistake. Like 99% of bugs.

I was ONLY checking on a specific part of my game, which hasn’t been tested before I made the upgrade. Your comment made me go ahead and test other places which were working fine. So I doubled and tripled checked.

This new piece was the only piece of entry that had multiple words in it. They key was made by separating those words with an _ and the code was looking for it with a space.

Thank you for your quick answer like always!

1 Like