Fix eSEL FFDC index error

This is because of an eSEL bug openbmc/openbmc#1297.

From the robot framework documentation "The execution is not continued
if the failure is caused by invalid syntax, timeout, or fatal exception."

"Resolving variable '${esel_data[0]}' failed:
IndexError: list index out of range" which is a fatal exception.

Resolves openbmc/openbmc-test-automation#451

Change-Id: I64c4d039e60eadfc6d5e436482bf0d9c377f7b54
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/openbmc_ffdc_methods.robot b/lib/openbmc_ffdc_methods.robot
index 9ff19ad..202d5ba 100755
--- a/lib/openbmc_ffdc_methods.robot
+++ b/lib/openbmc_ffdc_methods.robot
@@ -7,6 +7,7 @@
 Resource           utils.robot
 Library            SSHLibrary
 Library            OperatingSystem
+Library            Collections
 
 *** Keywords ***
 
@@ -286,6 +287,9 @@
 
     :FOR  ${entry_path}  IN  @{esel_list}
     \  ${esel_data}=  Read Attribute  ${entry_path}  AdditionalData  quiet=${1}
+    \  ${length}=  Get Length  ${esel_data}
+    # Skip writting to file if eSEL AdditionalData is empty
+    \  Continue For Loop If  ${length} == ${0}
     \  Write Data To File  "${esel_data[0]}"  ${logpath}
     \  Write Data To File  ${\n}  ${logpath}