diff --git a/sharethis.module b/sharethis.module
index 0c088d3..1036dee 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -473,14 +473,14 @@ function sharethis_get_button_HTML($data_options, $mPath, $mTitle) {
 
   if (!$data_options['onhover']) {
     // Disable hover popup.
-    $st_js .= '<script type="text/javascript">stLight.options({onhover: false});</script>';
+    $st_js .= '<script type="text/javascript">if (typeof stLight != "undefined") { stLight.options({onhover: false}); }</script>';
   }
 
   // Provide the publisher ID.
   $stlight = drupal_json_encode(array(
     'publisher' => $data_options['publisherID'],
   ));
-  $st_js .= "<script type='text/javascript'>stLight.options($stlight);</script>";
+  $st_js .= "<script type='text/javascript'>if (typeof stLight != 'undefined') { stLight.options($stlight); }</script>";
   return '<div class="sharethis-wrapper">' . $st_spans . $st_js . '</div>';
 }
 
