Skip to content

Commit 232d517

Browse files
authored
Fix issue for PVS-Studio (#14371)
1 parent ab4ab77 commit 232d517

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/HDInsight/HDInsight/JobCommands/InvokeHiveCommand.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ public override void ExecuteCmdlet()
109109
var resourceGroup =
110110
SessionState.PSVariable.Get(UseAzureHDInsightClusterCommand.CurrentResourceGroup).Value.ToString();
111111

112-
_credential = new BasicAuthenticationCloudCredentials
113-
{
114-
Username = clusterCred.UserName,
115-
Password = clusterCred.Password.ConvertToString()
116-
};
117-
118112
if (clusterConnection == null || clusterCred == null)
119113
{
120114
throw new NullReferenceException(
121115
string.Format(
122116
"The cluster or resource group specified is null. Please use the Use-AzHDInsightCluster command to connect to a cluster."));
123117
}
124118

119+
_credential = new BasicAuthenticationCloudCredentials
120+
{
121+
Username = clusterCred.UserName,
122+
Password = clusterCred.Password.ConvertToString()
123+
};
124+
125125
//get hive job
126126
var hivejob = hiveJobDefinitionCommand.GetHiveJob();
127127

0 commit comments

Comments
 (0)