diff --git a/platform/commonUI/formats/bundle.json b/platform/commonUI/formats/bundle.json index 738ce1bb63..8f9b23d5f5 100644 --- a/platform/commonUI/formats/bundle.json +++ b/platform/commonUI/formats/bundle.json @@ -7,7 +7,7 @@ "provides": "formatService", "type": "provider", "implementation": "FormatProvider.js", - "depends": [ "formats[]" ] + "depends": [ "formats[]", "$log" ] } ], "formats": [ diff --git a/platform/commonUI/formats/src/FormatProvider.js b/platform/commonUI/formats/src/FormatProvider.js index e72dd52b68..421d9bfd39 100644 --- a/platform/commonUI/formats/src/FormatProvider.js +++ b/platform/commonUI/formats/src/FormatProvider.js @@ -85,7 +85,7 @@ define([ * @param {Array.} format constructors, * from the `formats` extension category. */ - function FormatProvider(formats) { + function FormatProvider(formats, $log) { var formatMap = {}; function addToMap(Format) { @@ -97,10 +97,15 @@ define([ formats.forEach(addToMap); this.formatMap = formatMap; + this.$log = $log; } FormatProvider.prototype.getFormat = function (key) { - return this.formatMap[key]; + var format = this.formatMap[key]; + if (!format) { + this.$log.warn("No format found for " + key); + } + return format; }; return FormatProvider;