Skip to content

Commit f82b138

Browse files
authored
Merge pull request #228 from orangemug/fix/source-layer-guard
Added guard to <LayerSourceLayerBlock/> sourceLayerIds
2 parents 0e4c06c + 89c3899 commit f82b138

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/layers/LayerEditor.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export default class LayerEditor extends React.Component {
117117
comment = this.props.layer.metadata['maputnik:comment']
118118
}
119119

120+
let sourceLayerIds;
121+
if(this.props.sources.hasOwnProperty(this.props.layer.source)) {
122+
sourceLayerIds = this.props.sources[this.props.layer.source].layers;
123+
}
124+
120125
switch(type) {
121126
case 'layer': return <div>
122127
<LayerIdBlock
@@ -134,7 +139,7 @@ export default class LayerEditor extends React.Component {
134139
/>
135140
}
136141
{this.props.layer.type !== 'raster' && this.props.layer.type !== 'background' && <LayerSourceLayerBlock
137-
sourceLayerIds={this.props.sources[this.props.layer.source].layers}
142+
sourceLayerIds={sourceLayerIds}
138143
value={this.props.layer['source-layer']}
139144
onChange={v => this.changeProperty(null, 'source-layer', v)}
140145
/>

0 commit comments

Comments
 (0)