This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,16 @@ private AuthenticationService AuthenticationService
34
34
{
35
35
if ( authenticationService == null )
36
36
{
37
- var host = Repository != null
38
- ? new UriString ( Repository . CloneUrl . ToRepositoryUri ( ) . GetComponents ( UriComponents . SchemeAndServer , UriFormat . SafeUnescaped ) )
39
- : UriString . ToUriString ( HostAddress . GitHubDotComHostAddress . WebUri ) ;
37
+ UriString host ;
38
+ if ( Repository != null && Repository . CloneUrl != null && Repository . CloneUrl . IsValidUri )
39
+ {
40
+ host = new UriString ( Repository . CloneUrl . ToRepositoryUri ( )
41
+ . GetComponents ( UriComponents . SchemeAndServer , UriFormat . SafeUnescaped ) ) ;
42
+ }
43
+ else
44
+ {
45
+ host = UriString . ToUriString ( HostAddress . GitHubDotComHostAddress . WebUri ) ;
46
+ }
40
47
41
48
AuthenticationService = new AuthenticationService ( host , new AppConfiguration ( ) , Platform . Keychain ) ;
42
49
}
Original file line number Diff line number Diff line change @@ -223,9 +223,16 @@ private void GoToProfile(object obj)
223
223
}
224
224
private void SignOut ( object obj )
225
225
{
226
- var host = Repository != null
227
- ? new UriString ( Repository . CloneUrl . ToRepositoryUri ( ) . GetComponents ( UriComponents . SchemeAndServer , UriFormat . SafeUnescaped ) )
228
- : UriString . ToUriString ( HostAddress . GitHubDotComHostAddress . WebUri ) ;
226
+ UriString host ;
227
+ if ( Repository != null && Repository . CloneUrl != null && Repository . CloneUrl . IsValidUri )
228
+ {
229
+ host = new UriString ( Repository . CloneUrl . ToRepositoryUri ( )
230
+ . GetComponents ( UriComponents . SchemeAndServer , UriFormat . SafeUnescaped ) ) ;
231
+ }
232
+ else
233
+ {
234
+ host = UriString . ToUriString ( HostAddress . GitHubDotComHostAddress . WebUri ) ;
235
+ }
229
236
230
237
var apiClient = ApiClient . Create ( host , Platform . Keychain , new AppConfiguration ( ) ) ;
231
238
apiClient . Logout ( host ) ;
You can’t perform that action at this time.
0 commit comments