OSDN Git Service

Fix error on user has no credential.
authorTatsuki Sugiura <sugi@nemui.org>
Tue, 22 Mar 2016 09:26:03 +0000 (18:26 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Tue, 22 Mar 2016 09:26:03 +0000 (18:26 +0900)
lib/osdn/cli.rb

index dc5faa7..b397d10 100644 (file)
@@ -83,6 +83,10 @@ module OSDN
         def update_token
           logger.debug "Checking token expires..."
           load_credential
+          unless credential.access_token
+            logger.fatal "You have no access token. Please login with '#{$0} login'."
+            return
+          end
           if credential.expires_at > Time.now + 30
             logger.debug "You have valid access token, skip to refresh."
             return