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;
|
||||
};
|
||||
|
||||
PublicIP = instance.PublicIpAddress;
|
||||
PrivateIP = instance.PrivateIpAddress;
|
||||
PublicIP = instance.PublicIpAddress ?? "";
|
||||
PrivateIP = instance.PrivateIpAddress ?? "";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ namespace mRemoteNG.Connection
|
||||
try
|
||||
{
|
||||
string host = await ExternalConnectors.AWS.EC2FetchDataService.GetEC2InstanceDataAsync("AWSAPI:" + connectionInfo.EC2InstanceId, connectionInfo.EC2Region);
|
||||
connectionInfo.Hostname = host;
|
||||
if (!string.IsNullOrEmpty(host))
|
||||
connectionInfo.Hostname = host;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user