View Single Post
01/13/15, 06:59 AM   #12
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Garkin View Post
Everywhere, where are you using method :GetMaterialQuantity is a check if return value exists. But in the SetupFunction in :InitializeMaterialList is this check missing. There should probably be something like this:

Lua Code:
  1. local function SetupFunction(control, data, selected, selectedDuringRebuild, enabled)
  2.  
  3.     --original code here
  4.  
  5.     local currentSelectedQuantity = self:GetMaterialQuantity(data.patternIndex, data.materialIndex)
  6.     --added check if return value exists:
  7.     if not currentSelectedQuantity then
  8.         self:SetMaterialQuantity(data.patternIndex, data.materialIndex, data.min)
  9.         currentSelectedQuantity = data.min
  10.     end
  11.  
  12.    --rest of the original code
  13.  
  14. end
This code was added to EsoUI source in patch 1.5.8. ;-)
  Reply With Quote