Skip to content

Commit

Permalink
Fix a error when rendering sources without creators/contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgolden committed Dec 13, 2015
1 parent 302e2aa commit 121f62b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/shared/source.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";

var React = require('react')
, Immutable = require('immutable')

function oneOf(data, ...paths) {
var result;
Expand Down Expand Up @@ -39,7 +40,7 @@ module.exports = React.createClass({
value: (() => {
var val = oneOf(source, ['creators'], ['partOf', 'creators']);

val = val.toList().filter(c => c.get('name'));
val = (val || Immutable.List()).toList().filter(c => c.get('name'));
return val.size ? val : null;
})(),
format: creators => creators.map(c =>
Expand All @@ -51,8 +52,7 @@ module.exports = React.createClass({
value: (() => {
var val = oneOf(source, ['contributors'], ['partOf', 'contributors']);

val = val.toList().filter(c => c.get('name'));

val = (val || Immutable.List()).toList().filter(c => c.get('name'));
return val.size ? val : null;
})(),
format: contributors => contributors.map(c =>
Expand Down

0 comments on commit 121f62b

Please sign in to comment.