Skip to content

Commit 2c24062

Browse files
handle edge cases for gitlab and github kit
1 parent 9009784 commit 2c24062

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/components/github/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import GithubPullRequestsList from "./githubpullreqeusts";
44
import GithubRepo from "./githubrepo";
55

66
const Github = (props) => {
7-
if(props.type === 'issues'){
7+
if(props.type === 'issues' && typeof props.githubData.issues !== "undefined"){
88
return (<GithubIssuesList data={props.githubData}/>);
9-
}else if(props.type === 'pulls'){
9+
}else if(props.type === 'pulls' && typeof props.githubData.pulls !== "undefined"){
1010
return(<GithubPullRequestsList data={props.githubData}/>)
11-
}else if(props.type === 'contributors'){
11+
}else if(props.type === 'contributors' && typeof props.githubData.contributors !== "undefined"){
1212
return (<ContributorsList data={props.githubData}/>);
1313
}
1414
return (<GithubRepo data={props.githubData.repositoryData}/>);

app/components/gitlab/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import GitlabMergeList from "./gitlabMergeRequestList";
44
import GitlabProject from "./gitlabProject";
55

66
const Gitlab = (props) => {
7-
if(props.type === 'issues'){
7+
if(props.type === 'issues'&& typeof props.gitlabData.issues !=="undefined"){
88
return (<GitlabIssuesList data={props.gitlabData}/>);
9-
}else if(props.type === 'merges'){
9+
}else if(props.type === 'merges' && typeof props.gitlabData.merges !=="undefined"){
1010
return(<GitlabMergeList data={props.gitlabData}/>)
11-
}else if(props.type === 'members'){
11+
}else if(props.type === 'members' && typeof props.gitlabData.members!=="undefined"){
1212
return (<MembersList data={props.gitlabData}/>);
1313
}
1414
return (<GitlabProject data={props.gitlabData.project_data}/>);

0 commit comments

Comments
 (0)