From 0da8c63100d6997075ac03c37b42815ee2b23117 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 3 Mar 2016 14:42:57 -0300 Subject: [PATCH] Fix getting name of a block --- src/app/components/noosfero-blocks/block.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/noosfero-blocks/block.component.ts b/src/app/components/noosfero-blocks/block.component.ts index f1793a5..e9d2207 100644 --- a/src/app/components/noosfero-blocks/block.component.ts +++ b/src/app/components/noosfero-blocks/block.component.ts @@ -11,7 +11,7 @@ export class Block { @Input() owner: any; ngOnInit() { - let blockName = this.block.type ? this.block.type.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() : "default-block"; + let blockName = (this.block && this.block.type) ? this.block.type.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() : "default-block"; this.$element.replaceWith(this.$compile('')(this.$scope)); } -- libgit2 0.21.2