Skip to content

Commit

Permalink
[fix] check for falsy definition and ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tjwebb committed Mar 28, 2016
1 parent 94f8d29 commit 6c080d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spatial.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const SpatialUtil = {
},

isSpatialColumn (definition) {
if (!definition.dbType) return false
if (!definition || !definition.dbType) return false

let [ $, dbType, geoType, srid ] = SpatialUtil.spatialTypeRegex.exec(definition.dbType) || [ ]
return dbType === 'geometry'
Expand Down
1 change: 1 addition & 0 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ const Util = {
castResultValues (values, schema) {
return _.mapValues(values, (value, attr) => {
let definition = schema.definition[attr]
if (!definition) return value

if (SpatialUtil.isSpatialColumn(definition)) {
try {
Expand Down

0 comments on commit 6c080d9

Please sign in to comment.