Explorar o código

Update AccountService, fix json casting

Daniel Supernault %!s(int64=3) %!d(string=hai) anos
pai
achega
e5f8f3441c
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      app/Services/AccountService.php

+ 4 - 2
app/Services/AccountService.php

@@ -51,12 +51,14 @@ class AccountService
 		->map(function($item, $key) {
 			if($key == 'compose_settings') {
 				$cs = self::defaultSettings()['compose_settings'];
-				return array_merge($cs, $item ?? []);
+				$ms = is_array($item) ? $item : [];
+				return array_merge($cs, $ms);
 			}
 
 			if($key == 'other') {
 				$other =  self::defaultSettings()['other'];
-				return array_merge($other, $item ?? []);
+				$mo = is_array($item) ? $item : [];
+				return array_merge($other, $mo);
 			}
 			return $item;
 		});