diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module
index 2241371..f77675a 100644
--- a/core/modules/entity/entity.module
+++ b/core/modules/entity/entity.module
@@ -368,19 +368,20 @@ function entity_uri($entity_type, $entity) {
   elseif (isset($info['uri callback'])) {
     $uri_callback = $info['uri callback'];
   }
-  else {
-    return NULL;
-  }
 
-  // Invoke the callback to get the URI. If there is no callback, return NULL.
+  // Invoke the callback to get the URI.
   if (isset($uri_callback)) {
-    $uri = $uri_callback($entity);
-    // Pass the entity data to url() so that alter functions do not need to
-    // lookup this entity again.
-    $uri['options']['entity_type'] = $entity_type;
-    $uri['options']['entity'] = $entity;
-    return $uri;
+    if ($uri = $uri_callback($entity)) {
+      // Pass the entity data to url() so that alter functions do not need to
+      // lookup this entity again.
+      $uri['options']['entity_type'] = $entity_type;
+      $uri['options']['entity'] = $entity;
+      return $uri;
+    }
   }
+
+  // Return NULL if there is no callback, or the callback returned FALSE.
+  return NULL;
 }
 
 /**
