Browse Source

SVGLoader: Check node.style is not undefined

yomboprime 5 năm trước cách đây
mục cha
commit
450fa1bb94
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      examples/js/loaders/SVGLoader.js
  2. 1 1
      examples/jsm/loaders/SVGLoader.js

+ 1 - 1
examples/js/loaders/SVGLoader.js

@@ -795,7 +795,7 @@ THREE.SVGLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype
 				};
 
 				if ( node.hasAttribute( svgName ) ) style[ jsName ] = adjustFunction( node.getAttribute( svgName ) );
-				if ( node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] );
+				if ( node.style && node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] );
 
 			}
 

+ 1 - 1
examples/jsm/loaders/SVGLoader.js

@@ -808,7 +808,7 @@ SVGLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 				};
 
 				if ( node.hasAttribute( svgName ) ) style[ jsName ] = adjustFunction( node.getAttribute( svgName ) );
-				if ( node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] );
+				if ( node.style && node.style[ svgName ] !== '' ) style[ jsName ] = adjustFunction( node.style[ svgName ] );
 
 			}