Skip to content

Commit

Permalink
Add extra check on SingleServerApplianceToImage function in case the…
Browse files Browse the repository at this point in the history
… osFamily is null
  • Loading branch information
alibazlamit authored and nacx committed May 30, 2017
1 parent b3da4b3 commit 3b8f5c6
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -71,6 +71,9 @@ static boolean is64Bit(int architecture) {
}

private static Optional<OsFamily> findInStandardFamilies(final String osFamily) {
if (osFamily == null) {
return Optional.absent();
}
return tryFind(asList(OsFamily.values()), new Predicate<OsFamily>() {
@Override
public boolean apply(OsFamily input) {
Expand All @@ -80,6 +83,9 @@ public boolean apply(OsFamily input) {
}

private static Optional<OsFamily> findInOtherOSMap(final String label) {
if (label == null) {
return Optional.absent();
}
return tryFind(OTHER_OS_MAP.keySet(), new Predicate<String>() {
@Override
public boolean apply(String input) {
Expand Down

0 comments on commit 3b8f5c6

Please sign in to comment.