File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export function activate(): void {
2323 }
2424
2525 const uri = resolveURI ( editor . document . uri )
26+ if ( ! uri ) {
27+ return
28+ }
2629
2730 const threads = await fetchDiscussionThreads ( {
2831 first : 10000 ,
Original file line number Diff line number Diff line change 22 * Resolve a URI of the forms git://github.com/owner/repo?rev#path and file:///path to an absolute reference, using
33 * the given base (root) URI.
44 */
5- export function resolveURI ( uri : string ) : { repo : string ; rev : string ; path : string } {
5+ export function resolveURI ( uri : string ) : { repo : string ; rev : string ; path : string } | null {
66 const url = new URL ( uri )
77 if ( url . protocol === 'git:' ) {
88 return {
@@ -11,5 +11,5 @@ export function resolveURI(uri: string): { repo: string; rev: string; path: stri
1111 path : url . hash . slice ( 1 ) ,
1212 }
1313 }
14- throw new Error ( `unrecognized URI: ${ JSON . stringify ( uri ) } (supported URI schemes: git)` )
14+ return null
1515}
You can’t perform that action at this time.
0 commit comments