소스 검색

SVGLoader: Check node.style is not undefined

yomboprime 5 년 전
부모
커밋
450fa1bb94
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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 ] );
 
 			}