diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index fd87e874..bd27424b 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -241,7 +241,7 @@ def handle_update_kubeconfig_command(project_slug, command_args) end def handle_sleep_command(project_slug, command_args) - cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster).fetch(:name) + cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster)&.fetch(:name) return handle_missing_cluster_name_error if cluster_name.nil? response = scale_down_cluster(ConfigFile.read_option(:server), project_slug, cluster_name) @@ -256,7 +256,7 @@ def handle_sleep_command(project_slug, command_args) end def handle_wake_command(project_slug, command_args) - cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster).fetch(:name) + cluster_name = command_args[:cluster_name] || ConfigFile.read_option(:current_cluster)&.fetch(:name) return handle_missing_cluster_name_error if cluster_name.nil? response = scale_up_cluster(ConfigFile.read_option(:server), project_slug, cluster_name)