Add in missting string length check

BUG=chromium:754984

Change-Id: I106d460c80804797cee537d1990f901b5bf5a519
Reviewed-on: https://pdfium-review.googlesource.com/11171
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 2996316..0981541 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -1762,7 +1762,7 @@
   }
 
   CFX_WideString str = params[0].ToCFXWideString(pRuntime);
-  if (str[0] == L'.' || str[0] == L',')
+  if (str.GetLength() > 0 && (str[0] == L'.' || str[0] == L','))
     str = L"0" + str;
 
   CFX_WideString sPart;