fix for style crash

His Dad [05-02-15 - 22:17]
fix for style crash
Filename
AIResearchGrid.lua
doc/changelog.txt
diff --git a/AIResearchGrid.lua b/AIResearchGrid.lua
index d731ca6..7918824 100644
--- a/AIResearchGrid.lua
+++ b/AIResearchGrid.lua
@@ -9,7 +9,7 @@ local _
 AIRG = {}

 AIRG.name = "AIResearchGrid"
-AIRG.version = "3.2.8"
+AIRG.version = "3.2.9"
 AIRG.initialised = false
 AIRG.processing = false
 AIRG.all = " #ALL"  -- Default displayname for Virtual character, overrwritten by Localised version
@@ -549,6 +549,10 @@ function AIRG.PopulateAll()
             end
           end
         end
+		-- Fix crash for empty data.
+		if AIRG.vars.styles[thisname] == nil then
+			AIRG.vars.styles[thisname] = {}
+		end
         -- Update the Styles for this char.
         for style, known in pairs (AIRG.vars.styles[thisname]) do   --iterate over all styles
           if known  then
diff --git a/doc/changelog.txt b/doc/changelog.txt
index 99d40de..ab54f18 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,3 +1,7 @@
+2015-05-03  V3.2.9
+	Fix possible crash with empty styles
+
+
 2015-05-02  V3.2.8
 	somedays I should just stay in bed