We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fdfdd7 commit ec8de4eCopy full SHA for ec8de4e
1 file changed
extensions/git/src/uri.ts
@@ -17,7 +17,21 @@ export function isGitUri(uri: Uri): boolean {
17
}
18
19
export function fromGitUri(uri: Uri): GitUriParams {
20
- return qs.parse(uri.query) as any;
+ const result = qs.parse(uri.query) as any;
21
+
22
+ if (!result) {
23
+ throw new Error('Invalid git URI: empty query');
24
+ }
25
26
+ if (typeof result.path !== 'string') {
27
+ throw new Error('Invalid git URI: missing path');
28
29
30
+ if (typeof result.ref !== 'string') {
31
+ throw new Error('Invalid git URI: missing ref');
32
33
34
+ return result;
35
36
37
export interface GitUriOptions {
0 commit comments