File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 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)
368368 if ( Tools . VersionIsBeta ( version ) ) website = "https://unity3d.com/unity/beta/" + version ;
369369 if ( Tools . VersionIsAlpha ( version ) ) website = "https://unity3d.com/unity/alpha/" + version ;
370370
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
372372 website += "?unitylauncherpro" ;
373373
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+
376387 string [ ] lines = sourceHTML . Split ( new [ ] { "\r \n " , "\r " , "\n " } , StringSplitOptions . None ) ;
377388
378389 // patch version download assistant finder
You can’t perform that action at this time.
0 commit comments