File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class PlotLayer2D {
118118 off ( eventName ) {
119119 this . _eventHandlers . forEach ( ( s ) => {
120120 if ( s . eventName === eventName ) {
121- this . _fabricCanvas . off ( s . eventName , s . handler ) ;
121+ this . _fabricCanvas && this . _fabricCanvas . off ( s . eventName , s . handler ) ;
122122 }
123123 } ) ;
124124 }
@@ -278,10 +278,10 @@ class PlotLayer2D {
278278 const symbolManager = SymbolManager . instance ;
279279
280280 const leaf = symbolManager . getLeafByID ( id ) ;
281- if ( ! leaf ) return null ;
281+ if ( ! leaf ) return null ;
282282
283283 const element = await leaf . getElement ( ) ;
284- if ( ! element ) return null
284+ if ( ! element ) return null ;
285285 const plotObj = PlotObjectFactory . createInstance ( element . type , {
286286 element,
287287 positions : element . positions ,
@@ -435,7 +435,7 @@ class PlotLayer2D {
435435 * @description : 请求渲染
436436 */
437437 requestRenderAll ( ) {
438- this . _fabricCanvas . requestRenderAll ( ) ;
438+ this . _fabricCanvas && this . _fabricCanvas . requestRenderAll ( ) ;
439439 }
440440}
441441
You can’t perform that action at this time.
0 commit comments