PetTracker

PetTracker

13M Downloads

Objective Tracker - click on un-owned pet generate error

Horogg opened this issue ยท 1 comments

commented

Running Software (issues missing this information will be deleted):

  • Addon version: 8.3.5
  • Server patch: 8.3.0.33369

Describe the bug
Objective Tracker - click on un-owned pet open "Pet Journal", but do not open selected pet and generate LUA error. Click on owned pets (when option "Show Captured" is enabled) work OK.

Probably problem is here:

  • File: PetTracker\addons\main\classes\abstract\specie.lua
  • Function:
function Specie:GetID()
	return self:GetBestOwned():GetID()
end
  • My fix:
    I add this quick fix to my addon Kaliel's Tracker, before the problem is fixed.
function Specie:GetID()
	local best = self:GetBestOwned()
	return best and best:GetID() or nil
end

To Reproduce
Steps to reproduce the behaviour:

  1. Stay in zone with un-owned pet.
  2. Click on some pet in Objective Tracker.
  3. See error

Expected behaviour
Open "Pet Journal" with the selected pet I clicked without errors.

Error Logs

1x ...s\PetTracker\addons\main\classes\abstract\specie.lua:26: attempt to index a nil value
[string "@PetTracker\addons\main\classes\abstract\specie.lua"]:26: in function 'GetID'
[string "@PetTracker\addons\main\classes\abstract\pet-Pet.lua"]:33: in function 'Display'
[string "@PetTracker\addons\main\classes\tracking\tracker.lua"]:76: in function <...\PetTracker\addons\main\classes\tracking\tracker.lua:76>

Locals:
self = <table> {
 specie = 844
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index a nil value"
commented

I'm having this same issue!

Addon version: 8.3.6
Server patch: 8.3.0.33941

Describe the bug
I click on an unowned pet (red) in the objective tracker. It opens "Pet Journal" but doesn't bring up the unowned pet and generates a Lua Error dialog box. If I click on owned pets (green), the pet journal opens to that pet without generating the error dialog box. This error occurs when only "Collected" pets is marked in the filter of the Pet Journal AND when "Collected" and "Not Collected" pets are marked in the filter of the Pet Journal

To Reproduce
Steps to reproduce the behaviour:

  1. Have unowned pet(s) in objective tracker
  2. Click on unowned pet in objective tracker
  3. Error occurs

Expected behaviour
Clicking unowned pets in objective tracker should bring up the unowned pet's profile in the Pet Journal

Error Logs
Message: ...s\PetTracker\addons\main\classes\abstract\specie.lua:26: attempt to index a nil value
Time: Thu Apr 9 10:11:04 2020
Count: 2
Stack: ...s\PetTracker\addons\main\classes\abstract\specie.lua:26: attempt to index a nil value
[string "@interface\AddOns\PetTracker\addons\main\classes\abstract\specie.lua"]:26: in function GetID' [string "@Interface\AddOns\PetTracker\addons\main\classes\abstract\pet.lua"]:33: in function Display'
[string "@interface\AddOns\PetTracker\addons\main\classes\tracking\tracker.lua"]:76: in function <...\PetTracker\addons\main\classes\tracking\tracker.lua:76>

Locals: self =

{
specie = 558
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index a nil value"

Edit:

I tried Horogg's fix, above and the issue seems to be resolved!

Probably problem is here:

File: PetTracker\addons\main\classes\abstract\specie.lua
Function:

function Specie:GetID()
return self:GetBestOwned():GetID()
end

Horogg's fix:
I add this quick fix to my addon Kaliel's Tracker, before the problem is fixed.

function Specie:GetID()
local best = self:GetBestOwned()
return best and best:GetID() or nil
end