Skip to content

Commit 46e0979

Browse files
Kaushik Shettyjaychouhancontentstack
authored andcommitted
fix: return null if no installation uid present
1 parent d366256 commit 46e0979

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/extension.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare class Extension {
4747
* Conditionally gets and returns the app version if not present already
4848
* @returns version of the app currently running.
4949
*/
50-
getAppVersion: () => Promise<number>;
50+
getAppVersion: () => Promise<number | null>;
5151
getCurrentRegion: () => Region;
5252
static initialize(version: string): any;
5353
setReady(): any;

dist/src/extension.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,13 @@ class Extension {
377377
* Conditionally gets and returns the app version if not present already
378378
* @returns version of the app currently running.
379379
*/
380-
getAppVersion = async (): Promise<number> => {
380+
getAppVersion = async (): Promise<number | null> => {
381381
if (this.version) {
382382
return Promise.resolve(this.version);
383383
}
384+
if (!this.installationUID) {
385+
return Promise.resolve(null);
386+
}
384387
const orgUid = this.stack._data.org_uid;
385388
const options = {
386389
uid: this.installationUID,

0 commit comments

Comments
 (0)