From f97c50bb7d1dbf81dcffe802386a9e0f8dd6eb75 Mon Sep 17 00:00:00 2001 From: Pat O'Callaghan Date: Tue, 3 May 2016 10:50:45 +0100 Subject: [PATCH] Fix type.match crasher --- addon/converter/fixture-converter.js | 2 +- tests/dummy/app/models/employee.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/converter/fixture-converter.js b/addon/converter/fixture-converter.js index f1ec7480..de123fab 100644 --- a/addon/converter/fixture-converter.js +++ b/addon/converter/fixture-converter.js @@ -29,7 +29,7 @@ export default class { } getTransformValueFunction(type) { - if (!this.transformKeys || type.match('-mf')) { + if (!this.transformKeys || (type && type.match('-mf'))) { return this.noTransformFn; } if (!type) { diff --git a/tests/dummy/app/models/employee.js b/tests/dummy/app/models/employee.js index 81a3fcb3..e0bf403e 100644 --- a/tests/dummy/app/models/employee.js +++ b/tests/dummy/app/models/employee.js @@ -11,5 +11,6 @@ export default Model.extend({ titles : array('string'), gender : attr('string'), birthDate: attr('date'), + position: attr(), departmentEmployments : fragmentArray('department-employment') });