File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1- import { authenticationWrapper } from '../../../modules/authentication' ;
21import { IQuery } from '../../../types/query-runner' ;
2+ import { authenticationWrapper } from '../../../modules/authentication' ;
33import { encodeHashCharacters } from '../../utils/query-url-sanitization' ;
44import { parseSampleUrl } from '../../utils/sample-url-generation' ;
55
@@ -17,8 +17,15 @@ export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): s
1717 return '' ;
1818 }
1919
20- const url = new URL ( sampleUrl ) ;
21- const graphUrl = url . origin ;
20+ let graphUrl = 'https://graph.microsoft.com' ;
21+
22+ try {
23+ const url = new URL ( sampleUrl ) ;
24+ graphUrl = url . origin ;
25+ } catch {
26+ // do nothing and use default graph url
27+ }
28+
2229 const appUrl = 'https://developer.microsoft.com/graph/graph-explorer' ;
2330
2431 const graphUrlRequest = encodeURIComponent ( requestUrl + search ) ;
You can’t perform that action at this time.
0 commit comments