Skip to content

Commit 789b702

Browse files
committed
Strict check for undefined on URL attempts.
Otherwise an empty URL would result in Exception failing tests.
1 parent d487649 commit 789b702

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/XrmDefinitelyTyped/Resources/dg.xrmquery.web.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,13 +1305,12 @@ namespace XQW {
13051305
* @internal
13061306
*/
13071307
function getClientUrl() {
1308-
const url = getClientUrlFromGlobalContext()
1309-
|| getClientUrlFromUtility()
1310-
|| getClientUrlFromXrmPage();
1311-
1312-
if (url) {
1313-
return url;
1314-
}
1308+
let url = getClientUrlFromGlobalContext();
1309+
if (url !== undefined) return url;
1310+
url = getClientUrlFromUtility();
1311+
if (url !== undefined) return url;
1312+
url = getClientUrlFromXrmPage();
1313+
if (url !== undefined) return url;
13151314

13161315
throw new Error("Context is not available.");
13171316
}

0 commit comments

Comments
 (0)