Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 030f86f

Browse files
author
sowerstl
committed
Prevent NULL exception when manipulating Projects and Namespace is not set.
1 parent 95e2978 commit 030f86f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/gov/osti/connectors/api/GitLabAPI.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,11 @@ private String acquireCreateProjectCmd() {
523523

524524
// generate a valid GitLab API "project" command for the currently set GitLab and Project
525525
private String acquireProjectCmd() {
526-
return getApiBase() + "projects/" + encodeValue(getNamespace().getFullPath() + "/" + getProjectName());
526+
String namespace = "";
527+
if (getNamespace() != null)
528+
namespace = getNamespace().getFullPath() + "/";
529+
530+
return getApiBase() + "projects/" + encodeValue(namespace + getProjectName());
527531
}
528532

529533
/**

0 commit comments

Comments
 (0)