Skip to content

Commit

Permalink
fix(gcs): Prevent NPE when gcs artifact account has no credentials pa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Bloch-Wehba-Seaward authored Jan 29, 2018
1 parent 9d77c8b commit b51cd35
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.netflix.spinnaker.kork.artifacts.model.Artifact;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;

import java.io.FileInputStream;
import java.io.IOException;
Expand All @@ -50,7 +51,7 @@ public GcsArtifactCredentials(String applicationName, GcsArtifactAccount account

GoogleCredential credential;

if (!credentialsPath.isEmpty()) {
if (!StringUtils.isEmpty(credentialsPath)) {
FileInputStream stream = new FileInputStream(credentialsPath);
credential = GoogleCredential.fromStream(stream, transport, jsonFactory)
.createScoped(Collections.singleton(StorageScopes.DEVSTORAGE_READ_ONLY));
Expand Down

0 comments on commit b51cd35

Please sign in to comment.