diff --git a/geophp.module b/geophp.module
index 2f28707..14bc706 100644
--- a/geophp.module
+++ b/geophp.module
@@ -21,7 +21,8 @@ function geophp_load() {
     if (module_exists('libraries')) {
       $path = libraries_get_path('geoPHP');
       $file = $path . '/geoPHP.inc';
-      if (file_exists($file) && $static_cache !== TRUE) {
+      // check if a path for this library was found first
+      if ($path && file_exists($file) && $static_cache !== TRUE) {
         include_once($file);
         $already_found = TRUE;
       }
@@ -31,7 +32,7 @@ function geophp_load() {
     if (!$already_found) {
       $path = drupal_get_path('module', 'geophp');
       $file = $path . '/geoPHP/geoPHP.inc';
-      if (file_exists($file)) {
+      if ($path && file_exists($file)) {
         include_once($file);
         $static_cache = $file;
       }
