Skip to content

Commit e8a99c7

Browse files
committed
fix assign bug
1 parent 8107a63 commit e8a99c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/lib/processMaterial.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { processColor } from 'react-native';
2-
import { isString, mapValues, set } from 'lodash';
2+
import { isObject, isString, mapValues, set } from 'lodash';
33

44
// https://developer.apple.com/documentation/scenekit/scnmaterial
55
const propsWithMaps = ['normal', 'diffuse', 'displacement', 'specular'];
@@ -15,7 +15,7 @@ export default function processMaterial(material) {
1515
(prop, key) =>
1616
propsWithMaps.includes(key)
1717
? {
18-
...prop,
18+
...(isObject(prop) ? prop : {}),
1919
color: processColor(
2020
// allow for setting a diffuse colorstring { diffuse: 'colorstring'}
2121
key === 'diffuse' && isString(prop) ? prop : prop.color,

0 commit comments

Comments
 (0)