diff --git a/oauthconnector.module b/oauthconnector.module
index 8132253..f4f9163 100644
--- a/oauthconnector.module
+++ b/oauthconnector.module
@@ -128,7 +128,7 @@ function oauthconnector_endpoint_call($endpoint, $params=array(), $provider, $ac
       if ($e->getCode() == 401) {
         //TODO: Save the failure in some way so that we can stop trying to use a revoked token?
         watchdog('oauthconnector_endpoint_call', "User !uid not authenticated for %resource: @message", array(
-          '!uid' => $access_token->uid,
+          '!uid' => isset($access_token->uid) ? $access_token->uid : '\'undefined\'',
           '%resource' => $endpoint,
           '@message' => $e->getMessage(),
         ), WATCHDOG_WARNING);
