Skip to content

Commit 72043a2

Browse files
Angular SSR - Guard against empty renderToString result and missing scrollAnimator
1 parent 4f5a5a0 commit 72043a2

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/devextreme-angular/src/server/render.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export class DxServerModule {
2525
temp.innerHTML = renderToString(el);
2626

2727
const mainElement = temp.childNodes[0];
28+
if (!mainElement) {
29+
return;
30+
}
2831
const childString = mainElement.innerHTML;
2932

3033
for (let i = 0; i < mainElement.attributes.length; i++) {

packages/devextreme/js/__internal/m_draggable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class Draggable extends DOMComponent<Draggable, Properties> {
439439
}
440440

441441
_stopAnimator() {
442-
this._scrollAnimator.stop();
442+
this._scrollAnimator?.stop();
443443
}
444444

445445
_addWidgetPrefix(className?) {

0 commit comments

Comments
 (0)