Skip to content

Commit

Permalink
Fix 2 NPE that prevented using *non-dev* additional machines
Browse files Browse the repository at this point in the history
In the context of https://issues.jboss.org/browse/CHE-175

Signed-off-by: David Festal <dfestal@redhat.com>
  • Loading branch information
davidfestal committed Jun 15, 2017
1 parent 42f2903 commit 115dce1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1458,12 +1458,14 @@ private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspace
PersistentVolumeClaim pvc = getClaimCheWorkspace();
if (pvc != null) {
String subPath = getWorkspaceSubpath(volumes);
VolumeMount vm = new VolumeMountBuilder()
if (subPath != null) {
VolumeMount vm = new VolumeMountBuilder()
.withMountPath(cheWorkspaceProjectsStorage)
.withName(workspacesPersistentVolumeClaim)
.withSubPath(subPath)
.build();
vms.add(vm);
vms.add(vm);
}
}
return vms;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public static String getCheServerLabelPrefix() {
*/
public static Map<String, String> labelsToNames(Map<String, String> labels) {
Map<String, String> names = new HashMap<>();
if (labels == null) {
return names;
}
for (Map.Entry<String, String> label : labels.entrySet()) {

if (!hasConversionProblems(label)) {
Expand Down Expand Up @@ -103,6 +106,9 @@ public static Map<String, String> labelsToNames(Map<String, String> labels) {
*/
public static Map<String, String> namesToLabels(Map<String, String> names) {
Map<String, String> labels = new HashMap<>();
if (names == null) {
return labels;
}
for (Map.Entry<String, String> entry: names.entrySet()){
String key = entry.getKey();
String value = entry.getValue();
Expand Down

0 comments on commit 115dce1

Please sign in to comment.