From a9d90d08ae92b667097e237791f1dbf6de6705c8 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Thu, 29 May 2014 15:49:26 -0700 Subject: [PATCH] Fixing errors with missing story content from ifttt. --- apps/oauth/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/oauth/views.py b/apps/oauth/views.py index 2c883d039..98c090034 100644 --- a/apps/oauth/views.py +++ b/apps/oauth/views.py @@ -639,10 +639,11 @@ def api_share_new_story(request): story_content = original_story['content'] if not story_title: story_title = original_story['title'] - - story_content = lxml.html.fromstring(story_content) - story_content.make_links_absolute(story_url) - story_content = lxml.html.tostring(story_content) + + if story_content: + story_content = lxml.html.fromstring(story_content) + story_content.make_links_absolute(story_url) + story_content = lxml.html.tostring(story_content) shared_story = MSharedStory.objects.filter(user_id=user.pk, story_feed_id=original_feed and original_feed.pk or 0,