Skip to content

Commit d1f3161

Browse files
committed
gist ID undefined check
1 parent 76966c9 commit d1f3161

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "code-settings-sync",
33
"displayName": "Visual Studio Code Settings Sync",
44
"description": "Synchronize Settings, Snippets, launch, keybindings files and extensions Across Multiple Machines using Github GIST.",
5-
"version": "1.1.7",
5+
"version": "1.1.8",
66
"icon": "images/cloud.png",
77
"publisher": "Shan",
88
"author": {
@@ -22,7 +22,7 @@
2222
"email": "[email protected]"
2323
},
2424
"engines": {
25-
"vscode": "^0.10.9"
25+
"vscode": "^1.0.0"
2626
},
2727
"categories": [
2828
"Other"

src/extension.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ export function activate(context: vscode.ExtensionContext) {
132132
});
133133

134134

135-
if (sett.Gist == null || sett.Gist == "") {
135+
if (sett.Gist == null || sett.Gist === "") {
136136
await myGi.CreateNewGist(allSettingFiles).then(async function(gistID: string) {
137-
sett.Gist = gistID;
138-
139-
await common.SaveSettings(sett).then(function(added: boolean) {
137+
if (gistID) {
138+
sett.Gist = gistID;
139+
await common.SaveSettings(sett).then(function(added: boolean) {
140140
if (added) {
141141
vscode.window.showInformationMessage("Uploaded Successfully." + " GIST ID : " + gistID + " . Please copy and use this ID in other machines to sync all settings.");
142142
vscode.window.setStatusBarMessage("Gist Saved.", 1000);
@@ -146,8 +146,11 @@ export function activate(context: vscode.ExtensionContext) {
146146
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
147147
return;
148148
});
149-
150-
149+
}
150+
else{
151+
vscode.window.showErrorMessage("GIST ID: undefined" + common.ERROR_MESSAGE);
152+
return;
153+
}
151154
}, function(error: any) {
152155
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
153156
return;

0 commit comments

Comments
 (0)