Skip to content

Commit bc49f56

Browse files
author
Mark Robinson
committed
Fix null pointer error with blank paths
1 parent ad9f959 commit bc49f56

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/main/java/org/commonwl/view/github/GithubDetails.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class GithubDetails implements Serializable {
3434
public GithubDetails(String owner, String repoName, String branch, String path) {
3535
this.owner = owner;
3636
this.repoName = repoName;
37-
this.path = path;
3837

3938
// Default to the master branch
4039
if (branch == null || branch.isEmpty()) {
@@ -43,6 +42,13 @@ public GithubDetails(String owner, String repoName, String branch, String path)
4342
} else {
4443
this.branch = branch;
4544
}
45+
46+
// Default to root path
47+
if (path == null || path.isEmpty()) {
48+
this.path = "/";
49+
} else {
50+
this.path = path;
51+
}
4652
}
4753

4854
public String getOwner() {

src/main/resources/templates/fragments/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h1>Whoops - Something Went Wrong!</h1>
4040
</div>
4141
<p>
4242
If this error was unexpected, you can help us by
43-
<a href="https://github.com/common-workflow-language/cwlviewer/issues" rel="noopener" target="_blank">creating a Github issue</a>
43+
<a href="https://github.com/common-workflow-language/cwlviewer/issues" rel="noopener" target="_blank">creating a Github issue</a> with details on how to reproduce it
4444
and/or <a href="https://gitter.im/common-workflow-language/common-workflow-language" rel="noopener" target="_blank">discussing it on Gitter</a>
4545
</p>
4646
</div>

src/main/resources/templates/workflow.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ <h2>Steps</h2>
216216
(<span th:text="${step.value.runType}">Workflow</span>)
217217
</div>
218218
<div th:if="${step.value.run != null and step.value.runType == null}">
219-
<span th:text="${step.value.run} + '(?)'" class="notFound" data-tooltip="true" th:title="'Not Found - Must be somewhere within this repository">workflow.cwl (?)</span>
219+
<span th:text="${step.value.run} + '(?)'" class="notFound" data-tooltip="true" title="Not Found - Must be somewhere within this repository">workflow.cwl (?)</span>
220220
</div>
221221
</td>
222222
<td th:text="${step.value.label}">Label</td>

0 commit comments

Comments
 (0)