fix(plugin): work around lumina bug

This commit is contained in:
Anna 2020-12-08 23:26:26 -05:00
parent 0ed5804ce6
commit 5579f0dc3d
1 changed files with 9 additions and 1 deletions

View File

@ -147,6 +147,14 @@ namespace XIVChatPlugin {
jobName = this.plugin.Interface.Data.GetExcelSheet<ClassJob>().GetRow(entry.job)?.Name;
}
// FIXME: remove this try/catch when lumina fixes bug with .Value
string? territoryName;
try {
territoryName = this.plugin.Interface.Data.GetExcelSheet<TerritoryType>().GetRow(entry.territoryId)?.PlaceName?.Value?.Name;
} catch (NullReferenceException) {
territoryName = null;
}
var player = new Player {
Name = entry.Name(),
FreeCompany = entry.FreeCompany(),
@ -158,7 +166,7 @@ namespace XIVChatPlugin {
HomeWorldName = this.plugin.Interface.Data.GetExcelSheet<World>().GetRow(entry.homeWorldId)?.Name,
Territory = entry.territoryId,
TerritoryName = this.plugin.Interface.Data.GetExcelSheet<TerritoryType>().GetRow(entry.territoryId)?.PlaceName?.Value?.Name,
TerritoryName = territoryName,
Job = entry.job,
JobName = jobName,