File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ const EllipsisText = (props: IEllipsisTextProps) => {
78
78
* @return {* }
79
79
*/
80
80
const getStyle = ( dom : NewHTMLElement , attr : string ) => {
81
+ if ( ! dom ) {
82
+ return null ;
83
+ }
81
84
// Compatible width IE8
82
85
// @ts -ignore
83
86
return window . getComputedStyle ( dom ) [ attr ] || dom . currentStyle [ attr ] ;
@@ -203,7 +206,11 @@ const EllipsisText = (props: IEllipsisTextProps) => {
203
206
* @return {* }
204
207
*/
205
208
const onResize = ( ) => {
206
- const ellipsisNode = ellipsisRef . current ! ;
209
+ if ( ! ellipsisRef . current ) {
210
+ return ;
211
+ }
212
+
213
+ const ellipsisNode = ellipsisRef . current ;
207
214
const parentElement = ellipsisNode . parentElement ! ;
208
215
const rangeWidth = getRangeWidth ( ellipsisNode ) ;
209
216
const containerWidth = getContainerWidth ( parentElement ) ;
You can’t perform that action at this time.
0 commit comments