mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
fix null object bug in ec2 connector
This commit is contained in:
@@ -26,8 +26,9 @@ namespace ExternalConnectors.AWS
|
|||||||
default: Status = "Unknown"; break;
|
default: Status = "Unknown"; break;
|
||||||
};
|
};
|
||||||
|
|
||||||
PublicIP = instance.PublicIpAddress;
|
PublicIP = instance.PublicIpAddress ?? "";
|
||||||
PrivateIP = instance.PrivateIpAddress;
|
PrivateIP = instance.PrivateIpAddress ?? "";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ namespace mRemoteNG.Connection
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string host = await ExternalConnectors.AWS.EC2FetchDataService.GetEC2InstanceDataAsync("AWSAPI:" + connectionInfo.EC2InstanceId, connectionInfo.EC2Region);
|
string host = await ExternalConnectors.AWS.EC2FetchDataService.GetEC2InstanceDataAsync("AWSAPI:" + connectionInfo.EC2InstanceId, connectionInfo.EC2Region);
|
||||||
connectionInfo.Hostname = host;
|
if (!string.IsNullOrEmpty(host))
|
||||||
|
connectionInfo.Hostname = host;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user