From 57a00b68e5d0aa469f30154dfa94b75c4ae5b165 Mon Sep 17 00:00:00 2001
From: Samuel Wegner <samuelwegner@hotmail.com>
Date: Thu, 26 Nov 2015 21:45:23 -0600
Subject: [PATCH] Fix nil index error in makeParadoxClone

I'm not sure how/why it happened, but while testing the 1.3.2 beta cut
I got a nil index error in makeParadoxClone() while try to index on
getInven("INVEN"). My character did have an inventory, so this seems
strange. Anyway, it makes sense to check whether INVEN exists before
trying to skip it.

Now, the function checks whether INVEN exists before adding it to the
alt_nodes table.
---
 game/modules/tome/data/talents/chronomancy/chronomancer.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/game/modules/tome/data/talents/chronomancy/chronomancer.lua b/game/modules/tome/data/talents/chronomancy/chronomancer.lua
index 22a1f8b245..116623bd81 100644
--- a/game/modules/tome/data/talents/chronomancy/chronomancer.lua
+++ b/game/modules/tome/data/talents/chronomancy/chronomancer.lua
@@ -293,7 +293,7 @@ makeParadoxClone = function(self, target, duration, alt_nodes)
 
 	-- Don't copy certain fields from the target
 	alt_nodes = alt_nodes or {}
-	alt_nodes[target:getInven("INVEN")] = false -- Skip main inventory; equipped items are still copied
+	if target:getInven("INVEN") then alt_nodes[target:getInven("INVEN")] = false end -- Skip main inventory; equipped items are still copied
 	alt_nodes.quests = false
 	alt_nodes.random_escort_levels = false
 	alt_nodes.achievements = false
-- 
GitLab