From f0edc302bf351a8be5b22d6d2c60c10e3886ee8f Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Tue, 20 Oct 2015 22:06:08 -0700 Subject: [PATCH] Fixing filters creation --- libraries/controllers/src/controllers/UserInputMapper.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/controllers/src/controllers/UserInputMapper.cpp b/libraries/controllers/src/controllers/UserInputMapper.cpp index 74b3db0d57..0c47a2dce8 100755 --- a/libraries/controllers/src/controllers/UserInputMapper.cpp +++ b/libraries/controllers/src/controllers/UserInputMapper.cpp @@ -845,10 +845,15 @@ Route::Pointer UserInputMapper::parseRoute(const QJsonValue& value) { } const auto& filtersValue = obj[JSON_CHANNEL_FILTERS]; + // FIXME support strings for filters with no parameters, both in the array and at the top level... + // i.e. + // { "from": "Standard.DU", "to" : "Actions.LONGITUDINAL_FORWARD", "filters" : "invert" }, + // and + // { "from": "Standard.DU", "to" : "Actions.LONGITUDINAL_FORWARD", "filters" : [ "invert", "constrainToInteger" ] }, if (filtersValue.isArray()) { auto filtersArray = filtersValue.toArray(); for (auto filterValue : filtersArray) { - if (filterValue.isObject()) { + if (!filterValue.isObject()) { qWarning() << "Invalid filter " << filterValue; return Route::Pointer(); }