Skip to content

Commit

Permalink
Check for element prior to looking up parentNode in case of SSR. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and Robert-Frampton committed Dec 2, 2017
1 parent 628179e commit f1b8d5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/metal-incremental-dom/src/render/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ function getCurrentData() {
const element = IncrementalDOM.currentElement();
const comp = getComponentBeingRendered();
let obj = getData(comp);
if (obj.rootElementReached && element !== comp.element.parentNode) {
if (
obj.rootElementReached &&
comp.element &&
element !== comp.element.parentNode
) {
obj = domData.get(element);
}
obj.icComponentsData = obj.icComponentsData || {};
Expand Down

0 comments on commit f1b8d5f

Please sign in to comment.