Skip to content

Commit

Permalink
fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbadr committed Apr 16, 2024
1 parent aae6892 commit 922a17b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static boolean persistKubeConfigWithUpdatedAuthInfo(Config currentConfig,
if (namedAuthInfo.getUser() == null) {
namedAuthInfo.setUser(authInfo);
} else {
Optional.of(authInfo.getToken()).ifPresent(t -> namedAuthInfo.getUser().setToken(t));
Optional.ofNullable(authInfo.getToken()).ifPresent(t -> namedAuthInfo.getUser().setToken(t));
namedAuthInfo.getUser().getAuthProvider().getConfig().putAll(authInfo.getAuthProvider().getConfig());
}
// Persist changes to KUBECONFIG
Expand Down

0 comments on commit 922a17b

Please sign in to comment.