Check for variable to be defined

Change-Id: I41cf90c66398fd544f5cf53b6bad8e01277fed0d
diff --git a/plugin/templates/export.js b/plugin/templates/export.js
index cfb96f4..fbada53 100644
--- a/plugin/templates/export.js
+++ b/plugin/templates/export.js
@@ -1,3 +1,5 @@
+"use strict";
+
 function pluginit(P) {
   P.requestMsg(
     {
@@ -6,7 +8,7 @@
     },
     function (d) {
       let v = d.value;
-      if (v["q"]) {
+      if (v !== undefined && v["q"]) {
         let e = v["q"];
         document.getElementById("q").value=v["q"];
         if (v["ql"]) {