View Single Post
08/10/18, 08:53 AM   #5
SlippyCheeze
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 53
Originally Posted by Dekthro View Post
It is listed, I also tried adding in the debug output
Lua Code:
  1. function Dek01:Initialize()
  2.     d("Initializing")
  3.     Dek01.savedVars = ZO_SavedVars:New("Dek01Vars", Dek01.varVersion, nil, Dek01.Default)
  4.     Dek01.CreateSettingsWindow()
  5.     d(Dek01.savedVars.Show)
Ah. I see I wasn't quite clear here. I was suggesting something just before line 39:

Lua Code:
  1. d("window="..tostring(Dek01StaminaBarWindow))
  2. d("Dek01="..tostring(Dek01))
  3. d("Dek01.savedVars="..tostring(Dek01.savedVars))
  4. d("d.s.Show="..tostring(Dek01.savedVars.Show))
  5. -- line 39 contains this:
  6. Dek01StaminaBarWindow:SetHidden(not Dek01.savedVars.Show)

That should break on the line with the nil dereference, and make it clear where the issue is coming from. Then you have to figure out *why*, but that is a simpler problem once you know what.

PS: depending on taste, you may want to steal the `dmsg` function from my ReadItOnce addon, which automates the `tostring` parts of that.
  Reply With Quote