Skip to content

Commit 4479b8a

Browse files
committed
Fix externalpointerdata get crashing if offline
1 parent 6f391ed commit 4479b8a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

HCMExternal/Services/DataPointersService/DataPointersService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ public void LoadPointerDataFromSource(out string failedReads)
104104
}
105105

106106
#else
107-
107+
// Download the xml from git for latest version
108108
try
109109
{
110110
var client = new System.Net.Http.HttpClient();
111111
xml = client.GetStringAsync("https://raw.githubusercontent.com/Burnt-o/HaloCheckpointManager/master/HCMExternal/ExternalPointerData.xml").Result;
112112
}
113-
catch (HttpRequestException e)
113+
catch
114114
{
115-
Log.Error("Couldn't resolve github external pointer data, error: " + e.Message);
115+
// otherwise use embedded resource
116+
Log.Error("Couldn't resolve github external pointer data");
116117
// Couldn't grab online data, read offline embedded resource instead
117118
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HCMExternal.ExternalPointerData.xml");
118119
if (stream != null)
@@ -126,7 +127,7 @@ public void LoadPointerDataFromSource(out string failedReads)
126127

127128
#endif
128129

129-
// Download the xml from git
130+
130131

131132
if (xml == null || !xml.Any())
132133
{

0 commit comments

Comments
 (0)