Skip to content

Commit

Permalink
add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils89 committed Aug 23, 2024
1 parent 4b74dc6 commit ff3932f
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions character/reputation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,27 @@ local function updateSavedReputation()
savedReputation[factionIndex] = {}

if factionData.name == GUILD then
factionData = C_Reputation.GetGuildFactionData()
factionData = C_Reputation.GetGuildFactionData()
end
if factionData then
savedReputation[factionIndex].name = factionData.name
savedReputation[factionIndex].description = factionData.description
savedReputation[factionIndex].standingId = factionData.reaction
savedReputation[factionIndex].bottomValue = factionData.currentReactionThreshold
savedReputation[factionIndex].topValue = factionData.nextReactionThreshold
savedReputation[factionIndex].earnedValue = factionData.currentStanding
savedReputation[factionIndex].atWarWith = factionData.atWarWith
savedReputation[factionIndex].canToggleAtWar = factionData.canToggleAtWar
savedReputation[factionIndex].isHeader = factionData.isHeader
savedReputation[factionIndex].isCollapsed = factionData.isCollapsed
savedReputation[factionIndex].hasRep = factionData.isHeaderWithRep
savedReputation[factionIndex].isWatched = factionData.isWatched
savedReputation[factionIndex].isChild = factionData.isChild
savedReputation[factionIndex].factionID = factionData.factionID
savedReputation[factionIndex].hasBonusRepGain = factionData.hasBonusRepGain
savedReputation[factionIndex].canSetInactive = factionData.canSetInactive
savedReputation[factionIndex].isAccountWide = factionData.isAccountWide
end

savedReputation[factionIndex].name = factionData.name
savedReputation[factionIndex].description = factionData.description
savedReputation[factionIndex].standingId = factionData.reaction
savedReputation[factionIndex].bottomValue = factionData.currentReactionThreshold
savedReputation[factionIndex].topValue = factionData.nextReactionThreshold
savedReputation[factionIndex].earnedValue = factionData.currentStanding
savedReputation[factionIndex].atWarWith = factionData.atWarWith
savedReputation[factionIndex].canToggleAtWar = factionData.canToggleAtWar
savedReputation[factionIndex].isHeader = factionData.isHeader
savedReputation[factionIndex].isCollapsed = factionData.isCollapsed
savedReputation[factionIndex].hasRep = factionData.isHeaderWithRep
savedReputation[factionIndex].isWatched = factionData.isWatched
savedReputation[factionIndex].isChild = factionData.isChild
savedReputation[factionIndex].factionID = factionData.factionID
savedReputation[factionIndex].hasBonusRepGain = factionData.hasBonusRepGain
savedReputation[factionIndex].canSetInactive = factionData.canSetInactive
savedReputation[factionIndex].isAccountWide = factionData.isAccountWide
end
end
end
Expand Down

0 comments on commit ff3932f

Please sign in to comment.