File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,14 +103,22 @@ class Editor extends React.Component {
103103 } ;
104104
105105 const { adminToken } = this . props ;
106- if ( event . description . includes ( '<img' ) ) {
107- const height = event . description . split ( 'height: ' ) . pop ( ) . split ( 'px' ) . shift ( ) ;
108- const width = event . description . split ( 'width: ' ) . pop ( ) . split ( 'px' ) . shift ( ) ;
109- if ( height >= 800 ) {
110- event . description = event . description . replace ( 'height: ' + height , 'height: 800' ) ;
111- }
112- if ( width >= 1000 ) {
113- event . description = event . description . replace ( 'width: ' + width , 'width: 1000' ) ;
106+ if ( typeof event . description !== 'undefined' ) {
107+ if ( event . description . includes ( '<img' ) ) {
108+ const height = event . description . split ( 'height: ' )
109+ . pop ( )
110+ . split ( 'px' )
111+ . shift ( ) ;
112+ const width = event . description . split ( 'width: ' )
113+ . pop ( )
114+ . split ( 'px' )
115+ . shift ( ) ;
116+ if ( height >= 800 ) {
117+ event . description = event . description . replace ( 'height: ' + height , 'height: 800' ) ;
118+ }
119+ if ( width >= 1000 ) {
120+ event . description = event . description . replace ( 'width: ' + width , 'width: 1000' ) ;
121+ }
114122 }
115123 }
116124 if ( this . props . params . id === 'new' ) {
You can’t perform that action at this time.
0 commit comments