File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ class AlignmentGuides extends Component {
125125 selectBox ( e ) {
126126 const boundingBox = this . getBoundingBoxElement ( ) ;
127127 const boundingBoxPosition = boundingBox . current . getBoundingClientRect ( ) . toJSON ( ) ;
128- if ( e . target . id . indexOf ( 'box' ) >= 0 ) {
128+ if ( e . target && e . target . id . indexOf ( 'box' ) >= 0 ) {
129129 const boxDimensions = e . target . getBoundingClientRect ( ) . toJSON ( ) ;
130130 let data = {
131131 x : boxDimensions . x - boundingBoxPosition . x ,
@@ -177,7 +177,7 @@ class AlignmentGuides extends Component {
177177 } ) ;
178178 }
179179 this . props . onSelect && this . props . onSelect ( e , data ) ;
180- } else if ( e . target . parentNode . id . indexOf ( 'box' ) >= 0 ) {
180+ } else if ( e . target && e . target . parentNode && e . target . parentNode . id . indexOf ( 'box' ) >= 0 ) {
181181 const boxDimensions = e . target . parentNode . getBoundingClientRect ( ) . toJSON ( ) ;
182182 let data = {
183183 x : boxDimensions . x - boundingBoxPosition . x ,
@@ -233,7 +233,7 @@ class AlignmentGuides extends Component {
233233 }
234234
235235 unSelectBox ( e ) {
236- if ( e . target && e . target . id . indexOf ( 'box' ) === - 1 && e . target . parentNode . id . indexOf ( 'box' ) === - 1 ) {
236+ if ( e . target && e . target . id . indexOf ( 'box' ) === - 1 && e . target . parentNode && e . target . parentNode . id . indexOf ( 'box' ) === - 1 ) {
237237 if ( typeof this . props . isValidUnselect === 'function' && this . props . isValidUnselect ( e ) === false ) {
238238 return ;
239239 }
You can’t perform that action at this time.
0 commit comments