Commit f0e89c95e670c736441818256d230106e1d509cd

Authored by Eder Soares
1 parent 146ad31c
Exists in 2.9 and in 8 other branches 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8

Corrige quando nenhuma instituição está ativa

database/migrations/2019_03_08_201001_move_custom_labels_to_database.php
@@ -39,6 +39,10 @@ class MoveCustomLabelsToDatabase extends Migration @@ -39,6 +39,10 @@ class MoveCustomLabelsToDatabase extends Migration
39 ->where('active_on_ieducar', 1) 39 ->where('active_on_ieducar', 1)
40 ->first(); 40 ->first();
41 41
  42 + if (empty($setting)) {
  43 + return;
  44 + }
  45 +
42 $customLabels = json_decode($setting->custom_labels, true); 46 $customLabels = json_decode($setting->custom_labels, true);
43 $customLabels = is_array($customLabels) ? array_filter($customLabels) : []; 47 $customLabels = is_array($customLabels) ? array_filter($customLabels) : [];
44 48