File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -368,11 +368,22 @@ static string ParseDownloadURLFromWebpage(string version)
368
368
if ( Tools . VersionIsBeta ( version ) ) website = "https://unity3d.com/unity/beta/" + version ;
369
369
if ( Tools . VersionIsAlpha ( version ) ) website = "https://unity3d.com/unity/alpha/" + version ;
370
370
371
- // fix unity server problem, page says 404 found if no url params
371
+ // fix unity server problem, some pages says 404 found if no url params
372
372
website += "?unitylauncherpro" ;
373
373
374
- // download html
375
- string sourceHTML = client . DownloadString ( website ) ;
374
+ string sourceHTML = null ;
375
+ // need to catch 404 error
376
+ try
377
+ {
378
+ // download page html
379
+ sourceHTML = client . DownloadString ( website ) ;
380
+ }
381
+ catch ( WebException e )
382
+ {
383
+ Console . WriteLine ( e . Message ) ;
384
+ return null ;
385
+ }
386
+
376
387
string [ ] lines = sourceHTML . Split ( new [ ] { "\r \n " , "\r " , "\n " } , StringSplitOptions . None ) ;
377
388
378
389
// patch version download assistant finder
You can’t perform that action at this time.
0 commit comments