safer code
This commit is contained in:
@@ -85,12 +85,13 @@
|
||||
this.blockConfigurations.forEach(blockConfiguration => {
|
||||
|
||||
var scaffold = this.getScaffoldFor(blockConfiguration.contentTypeAlias);
|
||||
|
||||
blocks.push({
|
||||
alias: scaffold.contentTypeAlias,
|
||||
name: scaffold.contentTypeName,
|
||||
icon: scaffold.icon
|
||||
});
|
||||
if(scaffold) {
|
||||
blocks.push({
|
||||
alias: scaffold.contentTypeAlias,
|
||||
name: scaffold.contentTypeName,
|
||||
icon: scaffold.icon
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return blocks;
|
||||
@@ -110,6 +111,11 @@
|
||||
|
||||
var blockConfiguration = this.getBlockConfiguration(contentModel.contentTypeAlias);
|
||||
|
||||
if (blockConfiguration === null) {
|
||||
// This is not an allowed block type, therefor we return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO: make blockConfiguration the base for model, remeber to make a copy.
|
||||
var model = {
|
||||
label: "",
|
||||
|
||||
Reference in New Issue
Block a user