소스 검색

moved some code into try block for more defensive programming

Scrublord1336 6 년 전
부모
커밋
4453926036
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/XUnity.AutoTranslator.Plugin.Core/Web/GoogleTranslateEndpoint.cs

+ 4 - 4
src/XUnity.AutoTranslator.Plugin.Core/Web/GoogleTranslateEndpoint.cs

@@ -64,12 +64,12 @@ namespace XUnity.AutoTranslator.Plugin.Core.Web
          {
             _isSettingUp = true;
 
-            var headers = new Dictionary<string, string>();
-            ApplyHeaders( headers );
-            object www = WwwConstructor.Invoke( new object[] { Settings.EnableSSL ? HttpsTranslateUserSite : HttpTranslateUserSite, null, headers } );
-
             try
             {
+               var headers = new Dictionary<string, string>();
+               ApplyHeaders( headers );
+               object www = WwwConstructor.Invoke( new object[] { Settings.EnableSSL ? HttpsTranslateUserSite : HttpTranslateUserSite, null, headers } );
+
                return www;
             }
             catch( Exception e )