From 853ca318ec64a9e855d5b2cbc11701e06ed328ea Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 20 Jun 2014 15:44:26 +0200 Subject: [PATCH] Improved error handling. --- app/models/channel/twitter2.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/channel/twitter2.rb b/app/models/channel/twitter2.rb index d88496f73..260f7db24 100644 --- a/app/models/channel/twitter2.rb +++ b/app/models/channel/twitter2.rb @@ -112,7 +112,7 @@ class Channel::Twitter2 # check if parent exists user = nil, ticket = nil, article = nil - if tweet.respond_to?('in_reply_to_status_id') && tweet.in_reply_to_status_id + if tweet.respond_to?('in_reply_to_status_id') && tweet.in_reply_to_status_id && tweet.in_reply_to_status_id.to_s != '' puts 'import in_reply_tweet ' + tweet.in_reply_to_status_id.to_s tweet_sub = @client.status( tweet.in_reply_to_status_id ) # puts tweet_sub.inspect @@ -176,7 +176,7 @@ class Channel::Twitter2 # puts '+++++++++++++++++++++++++++' + tweet.inspect # check if ticket exists - if tweet.respond_to?('in_reply_to_status_id') && tweet.in_reply_to_status_id + if tweet.respond_to?('in_reply_to_status_id') && tweet.in_reply_to_status_id && tweet.in_reply_to_status_id.to_s != '' puts 'tweet.in_reply_to_status_id found: ' + tweet.in_reply_to_status_id.to_s article = Ticket::Article.where( :message_id => tweet.in_reply_to_status_id.to_s ).first if article