Skip to content
This repository was archived by the owner on Jul 13, 2022. It is now read-only.

Commit 01f10a3

Browse files
author
Shahak Yosef
committed
Merged PR 172763: Throw error is access token is empty
If setAccessToken is empty we need to throw an error.
1 parent d92a263 commit 01f10a3

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

dist/powerbi-client.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// powerbi-client v2.18.0
1+
// powerbi-client v2.18.1
22
// Copyright (c) Microsoft Corporation.
33
// Licensed under the MIT License.
44
declare module "util" {

dist/powerbi.js

+5-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-client",
3-
"version": "2.18.0",
3+
"version": "2.18.1",
44
"description": "JavaScript library for embedding Power BI into your apps. Provides service which makes it easy to embed different types of components and an object model which allows easy interaction with these components such as changing pages, applying filters, and responding to data selection.",
55
"main": "dist/powerbi.js",
66
"types": "dist/powerbi-client.d.ts",

src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/** @ignore *//** */
55
const config = {
6-
version: '2.18.0',
6+
version: '2.18.1',
77
type: 'js'
88
};
99

src/embed.ts

+3
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ export abstract class Embed {
446446
* @returns {Promise<void>}
447447
*/
448448
async setAccessToken(accessToken: string): Promise<void> {
449+
if (!accessToken) {
450+
throw new Error("Access token cannot be empty");
451+
}
449452
let embedType = this.config.type;
450453
embedType = (embedType === 'create' || embedType === 'visual' || embedType === 'qna') ? 'report' : embedType;
451454
try {

0 commit comments

Comments
 (0)