From 14a471fd0fe2736f255777fcbb49f1c877019864 Mon Sep 17 00:00:00 2001 From: OctoD roth Date: Tue, 25 Jul 2017 07:44:05 +0200 Subject: [PATCH] fix: Fixes an unhandled undefined, which causes theme to break (issue #69). --- extensions/commands/theme-variant/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/extensions/commands/theme-variant/index.ts b/extensions/commands/theme-variant/index.ts index 82a1709..d9de977 100644 --- a/extensions/commands/theme-variant/index.ts +++ b/extensions/commands/theme-variant/index.ts @@ -1,9 +1,11 @@ -import * as vscode from 'vscode'; -import { getDefaultValues, getPackageJSON, getAbsolutePath } from "../../helpers/fs"; -import { setCustomSettings, getCustomSettings } from "../../helpers/settings"; -import { THEME_ICONS } from "../theme-icons/index"; import * as fs from "fs"; +import * as vscode from 'vscode'; + +import { getAbsolutePath, getDefaultValues, getPackageJSON } from "../../helpers/fs"; +import { getCustomSettings, setCustomSettings } from "../../helpers/settings"; + import { CHARSET } from "../../consts/files"; +import { THEME_ICONS } from "../theme-icons/index"; import { reloadWindow } from "../../helpers/vscode"; export const THEME_VARIANT = () => { @@ -14,6 +16,8 @@ export const THEME_VARIANT = () => { options = options.filter(i => i !== packageJSON.contributes.themes[0].path); vscode.window.showQuickPick(options).then((response: string) => { + if (!response) return; + let customSettings = getCustomSettings(); let themepath: string = defaults.themeVariants[response]; let themeUITheme: string = defaults.themeVariantsUITheme[response];