Ver Fonte

fix update member - checkIsItaly

ferrari há 4 meses atrás
pai
commit
80381b4391
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      app/Http/Livewire/Member.php

+ 5 - 2
app/Http/Livewire/Member.php

@@ -586,8 +586,11 @@ class Member extends Component
 
 
     public function checkIsItaly()
     public function checkIsItaly()
     {
     {
-        $n = \App\Models\Nation::findOrFail($this->nation_id);
-        $this->isItaly = $n->is_italy;
+        if ($this->nation_id > 0) {
+            $n = \App\Models\Nation::findOrFail($this->nation_id);
+            $this->isItaly = $n->is_italy;
+        } else
+            $this->isItaly = false;
     }
     }
 
 
     public function checkIsBirthItaly()
     public function checkIsBirthItaly()