Skip to content

Commit

Permalink
contactDetails can be undefined when we have yet to fetch them
Browse files Browse the repository at this point in the history
And that's OK - so let's update the propTypes to reflect that.
  • Loading branch information
Igor Klimer committed Jul 12, 2017
1 parent 6170735 commit ac6f268
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ import QueryWhois from 'components/data/query-whois';

class IcannVerificationCard extends React.Component {
static propTypes = {
contactDetails: React.PropTypes.object,
explanationContext: React.PropTypes.string,
selectedDomainName: React.PropTypes.string.isRequired,
selectedSiteSlug: React.PropTypes.string.isRequired,
contactDetails: React.PropTypes.oneOfType( [
React.PropTypes.object,
React.PropTypes.bool
] ).isRequired,
};

state = {
Expand Down
2 changes: 1 addition & 1 deletion client/state/selectors/get-registrant-whois.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ import { findRegistrantWhois } from 'lib/domains/whois/utils';
* @return {Object} Contact details
*/
export default function getRegistrantWhois( state, domain ) {
const whoisContacts = get( state, [ 'domains', 'management', 'items', domain ], false );
const whoisContacts = get( state, [ 'domains', 'management', 'items', domain ], [] );
return findRegistrantWhois( whoisContacts );
}

0 comments on commit ac6f268

Please sign in to comment.