瀏覽代碼

Update AccountService, fix json casting

Daniel Supernault 3 年之前
父節點
當前提交
e5f8f3441c
共有 1 個文件被更改,包括 4 次插入2 次删除
  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;
 		});