From 200da893556bc40fff42da4560e3a8c0a1bae04a Mon Sep 17 00:00:00 2001
From: Robin Ward <robin.ward@gmail.com>
Date: Mon, 22 Feb 2016 22:11:35 -0500
Subject: [PATCH] FIX: Broken tests

---
 app/assets/javascripts/discourse/widgets/post.js.es6 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6
index b01f6fad9..47e071d5b 100644
--- a/app/assets/javascripts/discourse/widgets/post.js.es6
+++ b/app/assets/javascripts/discourse/widgets/post.js.es6
@@ -278,8 +278,8 @@ createWidget('post-contents', {
       return;
     }
 
-    const topic = this.findAncestorModel().get('topic');
-    const topicUrl = topic.get('url');
+    const post = this.findAncestorModel();
+    const topicUrl = post ? post.get('topic.url') : null;
     return this.store.find('post-reply', { postId: this.attrs.id }).then(posts => {
       this.state.repliesBelow = posts.map(p => {
         p.shareUrl = `${topicUrl}/${p.post_number}`;
@@ -356,8 +356,8 @@ createWidget('post-article', {
       this.state.repliesAbove = [];
       return Ember.RSVP.Promise.resolve();
     } else {
-      const topic = this.findAncestorModel().get('topic');
-      const topicUrl = topic.get('url');
+      const post = this.findAncestorModel();
+      const topicUrl = post ? post.get('topic.url') : null;
       return this.store.find('post-reply-history', { postId: this.attrs.id }).then(posts => {
         this.state.repliesAbove = posts.map((p) => {
           p.shareUrl = `${topicUrl}/${p.post_number}`;