Skip to content

Commit

Permalink
[schema] Fix edge case where accessing type.preview would fail (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Oct 3, 2017
1 parent ced4a67 commit fc111da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/@sanity/schema/src/preview/guessPreviewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function resolveFileAssetPath(typeDef) {
return fieldWithFileAsset ? `${fieldWithFileAsset.name}.asset` : undefined
}

export default function guessPreviewFields(objectTypeDef) {
export default function guessPreviewFields(rawObjectTypeDef) {
const objectTypeDef = {fields: [], ...rawObjectTypeDef}

const stringFieldNames = objectTypeDef.fields
.filter(field => field.type === 'string')
Expand Down

0 comments on commit fc111da

Please sign in to comment.