Commit f0e89c95e670c736441818256d230106e1d509cd
1 parent
146ad31c
Exists in
2.9
and in
8 other branches
Corrige quando nenhuma instituição está ativa
Showing
1 changed file
with
4 additions
and
0 deletions
Show diff stats
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 |