diff --git a/src/components/whatsapp/InstanceList.tsx b/src/components/whatsapp/InstanceList.tsx
index 21eedf1..b18ccd8 100644
--- a/src/components/whatsapp/InstanceList.tsx
+++ b/src/components/whatsapp/InstanceList.tsx
@@ -26,13 +26,26 @@ const InstanceList = ({
onRefreshInstances,
isRefreshing
}: InstanceListProps) => {
- if (instances.length === 0) {
+ // Safely check if instances is an array and has elements
+ const hasInstances = Array.isArray(instances) && instances.length > 0;
+
+ if (!hasInstances) {
return (
Nenhuma instância criada ainda. Crie uma instância usando o formulário acima. Clique em 'Atualizar Lista' para buscar novamente.