From 893f2aff2052b0809c70afac8a27b3e164635b44 Mon Sep 17 00:00:00 2001
From: Thibaut Girka <thib@sitedethib.com>
Date: Sat, 26 May 2018 19:21:02 +0200
Subject: Prevent a rare crash when a status' root node is undefined

---
 app/javascript/flavours/glitch/components/status.js | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'app')

diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js
index c93705266..a90ff491e 100644
--- a/app/javascript/flavours/glitch/components/status.js
+++ b/app/javascript/flavours/glitch/components/status.js
@@ -153,6 +153,11 @@ export default class Status extends ImmutablePureComponent {
       muted,
       prepend,
     } = this.props;
+
+    // Prevent a crash when node is undefined. Not completely sure why this
+    // happens, might be because status === null.
+    if (node === undefined) return;
+
     const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);
 
     if (function () {
-- 
cgit