File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,21 @@ public function deleteUser(IUser $user) {
134134 public function getUser (IUser $ user ) {
135135 $ uid = $ user ->getUID ();
136136 $ query = $ this ->connection ->getQueryBuilder ();
137- $ query ->select ('data ' )->from ($ this ->table )
137+ $ query ->select ('data ' )
138+ ->from ($ this ->table )
138139 ->where ($ query ->expr ()->eq ('uid ' , $ query ->createParameter ('uid ' )))
139140 ->setParameter ('uid ' , $ uid );
140- $ query ->execute ();
141- $ result = $ query ->execute ()->fetchAll ();
141+ $ result = $ query ->execute ();
142+ $ accountData = $ result ->fetchAll ();
143+ $ result ->closeCursor ();
142144
143- if (empty ($ result )) {
145+ if (empty ($ accountData )) {
144146 $ userData = $ this ->buildDefaultUserRecord ($ user );
145147 $ this ->insertNewUser ($ user , $ userData );
146148 return $ userData ;
147149 }
148150
149- $ userDataArray = json_decode ($ result [0 ]['data ' ], true );
151+ $ userDataArray = json_decode ($ accountData [0 ]['data ' ], true );
150152 $ jsonError = json_last_error ();
151153 if ($ userDataArray === null || $ userDataArray === [] || $ jsonError !== JSON_ERROR_NONE ) {
152154 $ this ->logger ->critical ("User data of $ uid contained invalid JSON (error $ jsonError), hence falling back to a default user record " );
You can’t perform that action at this time.
0 commit comments