From 5f1bf64ed38fdda9143b75f0ab847eebe55eaaaa Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sat, 20 Mar 2021 17:52:29 +0300
Subject: feat: allow extending Services

---
 src/containers/TransferForm.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/containers/TransferForm.tsx')

diff --git a/src/containers/TransferForm.tsx b/src/containers/TransferForm.tsx
index afb2dff..801150e 100644
--- a/src/containers/TransferForm.tsx
+++ b/src/containers/TransferForm.tsx
@@ -13,7 +13,7 @@ const TransferForm: React.FC<FormikProps> = ({ setFieldValue, values }) => {
   const { data: contractors } = hooks.contractors.useList();
 
   if (!values.date) setFieldValue('date', moment().format('YYYY-MM-DD'));
-  if (!values.contractorId && contractors) setFieldValue('contractorId', contractors[0]._id);
+  if (!values.contractorId && contractors?.length) setFieldValue('contractorId', contractors[0]._id);
 
   return (
     <Form id="form">
-- 
cgit v1.2.3

