Skip to content

Commit dfbb4c2

Browse files
committed
Remove error if attempting to reset an element and it does not have associated component.
1 parent 68489cd commit dfbb4c2

File tree

5 files changed

+5
-18
lines changed

5 files changed

+5
-18
lines changed

dist/powerbi.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/powerbi.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/powerbi.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class PowerBi {
163163
const powerBiElement = <IPowerBiElement>element;
164164

165165
if (!powerBiElement.powerBiEmbed) {
166-
throw new Error(`You attempted to get an instance of powerbi component associated with element: ${element.outerHTML} but there was no associated instance.`);
166+
return;
167167
}
168168

169169
/** Remove component from internal list */

test/core.spec.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -239,19 +239,6 @@ describe('powerbi', function () {
239239
});
240240

241241
describe('reset', function () {
242-
it('throws an error if the element being reset does not have embedded component associated with it', function () {
243-
// Arrange
244-
const $element = $('<div></div>');
245-
246-
// Act
247-
const attemptToReset = () => {
248-
powerbi.reset($element.get(0));
249-
};
250-
251-
// Assert
252-
expect(attemptToReset).toThrowError();
253-
});
254-
255242
it('deletes the powerBiEmbed property on the element', function () {
256243
// Arrange
257244
const $element = $('<div></div>');

0 commit comments

Comments
 (0)