Skip to content

Commit 1f6ff85

Browse files
author
Kanta Asada
committed
Fix Cannot read property 'style' of null.
1 parent 1f22344 commit 1f6ff85

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,22 @@ class Popover extends React.Component {
236236
of the container. When tip changes orientation position due to changes from/to `row`/`column`
237237
width`/`height` will be impacted. Our layout monitoring will catch these cases and automatically
238238
recalculate layout. */
239-
240-
this.containerEl.style.flexFlow = zone.flow
241-
this.containerEl.style[
242-
jsprefix("FlexFlow")
243-
] = this.containerEl.style.flexFlow
239+
if (this.containerEl) {
240+
this.containerEl.style.flexFlow = zone.flow
241+
this.containerEl.style[
242+
jsprefix("FlexFlow")
243+
] = this.containerEl.style.flexFlow
244+
}
244245
this.bodyEl.style.order = zone.order
245246
this.bodyEl.style[jsprefix("Order")] = this.bodyEl.style.order
246247

247248
/* Apply Absolute Positioning. */
248249

249250
log("pos", pos)
250-
this.containerEl.style.top = `${pos.y}px`
251-
this.containerEl.style.left = `${pos.x}px`
251+
if (this.containerEl) {
252+
this.containerEl.style.top = `${pos.y}px`
253+
this.containerEl.style.left = `${pos.x}px`
254+
}
252255

253256
/* Calculate Tip Position */
254257

0 commit comments

Comments
 (0)