diff --git a/app/models/Project.java b/app/models/Project.java index c7d07c815..d63139ce4 100644 --- a/app/models/Project.java +++ b/app/models/Project.java @@ -571,6 +571,10 @@ public void changeVCS() throws Exception { this.update(); } + public boolean isCodeAvailable() { + return menuSetting == null || menuSetting.code; + } + public enum State { PUBLIC, PRIVATE, ALL } diff --git a/app/utils/AutoLinkRenderer.java b/app/utils/AutoLinkRenderer.java index 81e4e7269..60fc3e7d6 100644 --- a/app/utils/AutoLinkRenderer.java +++ b/app/utils/AutoLinkRenderer.java @@ -26,7 +26,9 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.jsoup.Jsoup; -import org.jsoup.nodes.*; +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; +import org.jsoup.nodes.TextNode; import org.jsoup.select.Elements; import org.tmatesoft.svn.core.SVNException; import playRepository.Commit; @@ -276,6 +278,10 @@ private Link toValidSHALink(Project project, String SHA) { private Link toValidSHALink(String prefix, Project project, String sha) { if (project != null) { try { + if (!project.isCodeAvailable()) { + return Link.EMPTY_LINK; + } + PlayRepository repository = RepositoryService.getRepository(project); if (repository != null) {