{
using (var client = new HttpClient())
using (HttpResponseMessage response = await client.GetAsync(uri, cancellationToken).ConfigureAwait(false))
- return await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
+ if (response.Content is var content && content != null)
+ return await content.ReadAsStreamAsync().ConfigureAwait(false);
+ else
+ return null;
}
public Assembly[] GetAssemblies()
object temp = null;
GlobalDataList eXamlData = null;
LoadEXaml.Load(temp, eXamlStr, out eXamlData);
- return eXamlData.Root;
+ return eXamlData?.Root;
}
/// Internal used, will never be opened.