summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/index.js b/app/index.js
index 7860f76..5f50cec 100644
--- a/app/index.js
+++ b/app/index.js
@@ -168,8 +168,7 @@ OKCMS.prototype._createViews = function(viewConfig, db,
if (!template) {
throw new Error(format('No template named "%s" found', templateName));
}
- var queryConfig = config.data || [];
- var queries = createQueries(queryConfig, resourceCache);
+ var queries = createQueries(config.data, resourceCache);
// Don't forget to add that trailing slash if the user forgot
cache[withTrailingSlash(route)] = OKView({
mount: 'get', // User defined views are read only
@@ -231,7 +230,8 @@ OKCMS.prototype._createAdminViews = function(path, app, express,
};
OKCMS.prototype._createQueries = function(queryConfig, resourceCache) {
- queryConfig = queryConfig || {};
+ if (!queryConfig)
+ return [];
if (!queryConfig.length)
queryConfig = [queryConfig];
return queryConfig.map(function(config) {