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) => {
7878 * @return {* }
7979 */
8080 const getStyle = ( dom : NewHTMLElement , attr : string ) => {
81+ if ( ! dom ) {
82+ return null ;
83+ }
8184 // Compatible width IE8
8285 // @ts -ignore
8386 return window . getComputedStyle ( dom ) [ attr ] || dom . currentStyle [ attr ] ;
@@ -203,7 +206,11 @@ const EllipsisText = (props: IEllipsisTextProps) => {
203206 * @return {* }
204207 */
205208 const onResize = ( ) => {
206- const ellipsisNode = ellipsisRef . current ! ;
209+ if ( ! ellipsisRef . current ) {
210+ return ;
211+ }
212+
213+ const ellipsisNode = ellipsisRef . current ;
207214 const parentElement = ellipsisNode . parentElement ! ;
208215 const rangeWidth = getRangeWidth ( ellipsisNode ) ;
209216 const containerWidth = getContainerWidth ( parentElement ) ;
You can’t perform that action at this time.
0 commit comments