Do not fail when service is nil.

Akinori MUSHA 10 years ago
parent
commit
f85b82a043
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/concerns/twitter_concern.rb

+ 2 - 1
app/concerns/twitter_concern.rb

@@ -13,6 +13,7 @@ module TwitterConcern
13 13
   def validate_twitter_options
14 14
     unless twitter_consumer_key.present? &&
15 15
       twitter_consumer_secret.present? &&
16
+      service &&
16 17
       twitter_oauth_token.present? &&
17 18
       twitter_oauth_token_secret.present?
18 19
       errors.add(:base, "Twitter consumer_key, consumer_secret, oauth_token, and oauth_token_secret are required to authenticate with the Twitter API.  You can provide these as options to this Agent, or as Credentials with the same names, but starting with 'twitter_'.")
@@ -49,4 +50,4 @@ module TwitterConcern
49 50
       "## Include the `twitter`, `omniauth-twitter`, and `cantino-twitter-stream` gems in your Gemfile to use Twitter Agents."
50 51
     end
51 52
   end
52
-end
53
+end