Only set source layer if not undefined

This commit is contained in:
Lukas Martinelli 2017-01-12 13:15:04 +01:00
parent 6be6db8f5e
commit 68685dcf42

View file

@ -31,7 +31,7 @@ class AddModal extends React.Component {
if(this.state.type !== 'background') {
layer.source = this.state.source
if(this.state.type !== 'raster') {
if(this.state.type !== 'raster' && this.state['source-layer']) {
layer['source-layer'] = this.state['source-layer']
}
}