From acb6c8ca25701c145a71a00bce6738afb2eeef63 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Sat, 22 Jul 2017 20:20:29 +0200 Subject: [PATCH] fix: if author property is not part of the pkg body ui crash --- src/webui/src/components/Package/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webui/src/components/Package/index.js b/src/webui/src/components/Package/index.js index 4d7b334a4..27baab692 100644 --- a/src/webui/src/components/Package/index.js +++ b/src/webui/src/components/Package/index.js @@ -2,6 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Tag} from 'element-react'; import {Link} from 'react-router-dom'; +import isNil from 'lodash/isNil'; import classes from './package.scss'; @@ -25,7 +26,7 @@ export default class Package extends React.Component { } renderAuthor(pkg) { - if (!pkg.author.name) { + if (isNil(pkg.author) || isNil(pkg.author.name)) { return; }