From 5c5ecebb8cb1f6e1f67d48df5d36fe27a7bd789a Mon Sep 17 00:00:00 2001 From: Fernando Lucchesi Date: Thu, 19 Jan 2023 10:07:53 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Improve=20validation=20#1438?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- studio/schemas/objects/linkSelector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/schemas/objects/linkSelector.tsx b/studio/schemas/objects/linkSelector.tsx index 7239b284c..05e4f4029 100644 --- a/studio/schemas/objects/linkSelector.tsx +++ b/studio/schemas/objects/linkSelector.tsx @@ -73,7 +73,7 @@ const LinkField = { Rule.custom(async (value: any, context: ValidationContext) => { const { parent, document } = context as { parent: LinkSelector; document: { _lang?: string } } if (parent.linkToOtherLanguage) return true - if (Flags.IS_DEV && value._ref) { + if (Flags.IS_DEV && value?._ref) { const referenceLang = await client.fetch( /* groq */ `*[_id == $id][0]{"lang": coalesce(content->_lang, _lang)}.lang`, {