Skip to content

Commit ccc75c4

Browse files
nclajasonvarga
andauthored
Fix focal point not saving when asset blueprint has no fields (#6814)
Co-authored-by: Jason Varga <jason@pixelfear.com>
1 parent 6761b67 commit ccc75c4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

resources/js/components/assets/Editor/Editor.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,11 @@ export default {
295295
this.$axios.get(url).then(response => {
296296
const data = response.data.data;
297297
this.asset = data;
298-
this.values = data.values;
298+
299+
// If there are no fields, it will be an empty array when PHP encodes
300+
// it into JSON on the server. We'll ensure it's always an object.
301+
this.values = _.isArray(data.values) ? {} : data.values;
302+
299303
this.meta = data.meta;
300304
this.actionUrl = data.actionUrl;
301305
this.actions = data.actions;

0 commit comments

Comments
 (0)