File tree 1 file changed +3
-3
lines changed
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 {
125
125
selectBox ( e ) {
126
126
const boundingBox = this . getBoundingBoxElement ( ) ;
127
127
const boundingBoxPosition = boundingBox . current . getBoundingClientRect ( ) . toJSON ( ) ;
128
- if ( e . target . id . indexOf ( 'box' ) >= 0 ) {
128
+ if ( e . target && e . target . id . indexOf ( 'box' ) >= 0 ) {
129
129
const boxDimensions = e . target . getBoundingClientRect ( ) . toJSON ( ) ;
130
130
let data = {
131
131
x : boxDimensions . x - boundingBoxPosition . x ,
@@ -177,7 +177,7 @@ class AlignmentGuides extends Component {
177
177
} ) ;
178
178
}
179
179
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 ) {
181
181
const boxDimensions = e . target . parentNode . getBoundingClientRect ( ) . toJSON ( ) ;
182
182
let data = {
183
183
x : boxDimensions . x - boundingBoxPosition . x ,
@@ -233,7 +233,7 @@ class AlignmentGuides extends Component {
233
233
}
234
234
235
235
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 ) {
237
237
if ( typeof this . props . isValidUnselect === 'function' && this . props . isValidUnselect ( e ) === false ) {
238
238
return ;
239
239
}
You can’t perform that action at this time.
0 commit comments