From 082b462188d01a81ff290376af2acb92301c0d0c Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Tue, 25 Sep 2018 22:32:01 +0200 Subject: [PATCH] fixed value error --- client/components/relativetime/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/components/relativetime/index.jsx b/client/components/relativetime/index.jsx index 540bdc5..b9f7faf 100644 --- a/client/components/relativetime/index.jsx +++ b/client/components/relativetime/index.jsx @@ -8,11 +8,14 @@ import React from 'react' export default class RelativeTime extends React.Component { render() { - let time = moment.utc(this.props.value); + if (!this.props.value) { + return null; + } + let time = moment.utc(this.props.value); return ( {time.fromNow(this.props.suffix)} - ) + ); } }