Skip to content

Commit fbf4451

Browse files
committed
Fix the action of add repository button
- If there is no repository for the OAuth token, show error dialog.
1 parent 53c2c48 commit fbf4451

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/junichi11/netbeans/modules/github/issues/repository/ui/GitHubRepositoryPanel.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,18 @@ public void run() {
457457
}
458458
setAddRepositoryButtonEnabled(false);
459459
List<Repository> repositories = GitHubRepository.getRepositories(oAuthToken);
460+
if (repositories.isEmpty()) {
461+
SwingUtilities.invokeLater(new Runnable() {
462+
463+
@Override
464+
public void run() {
465+
UiUtils.showErrorDialog("There is no repository or your OAuth token is wrong.");
466+
setAddRepositoryButtonEnabled(true);
467+
}
468+
});
469+
return;
470+
}
471+
460472
final Repository repository = GitHubRepositoryListPanel.showDialog(repositories);
461473

462474
SwingUtilities.invokeLater(new Runnable() {

0 commit comments

Comments
 (0)