File tree Expand file tree Collapse file tree
lib/Service/IdentifyMethod Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626use Psr \Log \LoggerInterface ;
2727
2828class IdentifyService {
29- private array $ savedSettings = [] ;
29+ private ? array $ savedSettings = null ;
3030 public function __construct (
3131 private IdentifyMethodMapper $ identifyMethodMapper ,
3232 private SessionService $ sessionService ,
@@ -126,10 +126,20 @@ private function refreshIdFromDatabaseIfNecessary(IdentifyMethod $identifyMethod
126126 }
127127
128128 public function getSavedSettings (): array {
129- if (! empty ( $ this ->savedSettings ) ) {
129+ if ($ this ->savedSettings !== null ) {
130130 return $ this ->savedSettings ;
131131 }
132- return $ this ->getAppConfig ()->getValueArray (Application::APP_ID , 'identify_methods ' , []);
132+
133+ try {
134+ $ this ->savedSettings = $ this ->getAppConfig ()->getValueArray (Application::APP_ID , 'identify_methods ' , []);
135+ } catch (\TypeError $ exception ) {
136+ $ this ->logger ->warning ('Invalid identify_methods app config; falling back to defaults. ' , [
137+ 'exception ' => $ exception ,
138+ ]);
139+ $ this ->savedSettings = [];
140+ }
141+
142+ return $ this ->savedSettings ;
133143 }
134144
135145 public function getEventDispatcher (): IEventDispatcher {
You can’t perform that action at this time.
0 commit comments