mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Add better checks for start index and length
This commit is contained in:
committed by
Johannes Rieken
parent
e169d55ba3
commit
084fb5e7bf
@@ -1713,10 +1713,10 @@ export class TerminalLink implements vscode.TerminalLink {
|
||||
public length: number,
|
||||
public tooltip?: string
|
||||
) {
|
||||
if (typeof startIndex !== 'number') {
|
||||
if (typeof startIndex !== 'number' || startIndex < 0) {
|
||||
throw illegalArgument('startIndex');
|
||||
}
|
||||
if (typeof length !== 'number') {
|
||||
if (typeof length !== 'number' || length < 1) {
|
||||
throw illegalArgument('length');
|
||||
}
|
||||
if (tooltip !== undefined && typeof tooltip !== 'string') {
|
||||
|
||||
Reference in New Issue
Block a user