Skip to content

Commit b59e749

Browse files
authored
fix linting issue (#495)
Signed-off-by: Yan Zhang <[email protected]>
1 parent 2d0f696 commit b59e749

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/overview/assets/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,26 @@ function installExtension(extName: string, displayName: string) {
5454
}
5555

5656
$("div[ext] > a").click(function () {
57-
installExtension($(this.parentElement).attr("ext") || "", $(this.parentElement).attr("displayName") || "");
57+
if (this.parentElement) {
58+
installExtension($(this.parentElement).attr("ext") || "", $(this.parentElement).attr("displayName") || "");
59+
}
5860
});
5961

6062
$("a[command]").click(function (event) {
6163
event.stopPropagation();
6264

6365
const command = $(this).attr("command") || "";
64-
const args = $(this).attr("args") || null;
66+
const args = $(this).attr("args") || undefined;
6567
execCommand(command, args);
6668
});
6769

6870
$("button[command]").click(function () {
6971
const command = $(this).attr("command") || "";
70-
const args = $(this).attr("args") || null;
72+
const args = $(this).attr("args") || undefined;
7173
execCommand(command, args);
7274
});
7375

74-
function execCommand(command: string, jsonArgs: string) {
76+
function execCommand(command: string, jsonArgs: string | undefined) {
7577
if (command) {
7678
let args = [];
7779
if (jsonArgs) {

0 commit comments

Comments
 (0)