@@ -267,18 +267,20 @@ private function getUserProfile($userId) {
267267 }
268268 }
269269 }
270- $ profile = array (
271- 'id ' => $ userId ,
272- 'displayName ' => $ user ->getDisplayName (),
273- 'profileUri ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.profile.handleGet " , array ("userId " => $ userId , "path " => "/card " ))) . "#me " ,
274- 'friends ' => $ friends ,
275- 'inbox ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/inbox/ " ))),
276- 'preferences ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/preferences.ttl " ))),
277- 'privateTypeIndex ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/privateTypeIndex.ttl " ))),
278- 'publicTypeIndex ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/publicTypeIndex.ttl " ))),
279- 'storage ' => $ this ->getStorageUrl ($ userId )
280- );
281- return $ profile ;
270+ if ($ user !== null ) {
271+ $ profile = array (
272+ 'id ' => $ userId ,
273+ 'displayName ' => $ user ->getDisplayName (),
274+ 'profileUri ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.profile.handleGet " , array ("userId " => $ userId , "path " => "/card " ))) . "#me " ,
275+ 'friends ' => $ friends ,
276+ 'inbox ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/inbox/ " ))),
277+ 'preferences ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/preferences.ttl " ))),
278+ 'privateTypeIndex ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/privateTypeIndex.ttl " ))),
279+ 'publicTypeIndex ' => $ this ->urlGenerator ->getAbsoluteURL ($ this ->urlGenerator ->linkToRoute ("solid.storage.handleGet " , array ("userId " => $ userId , "path " => "/settings/publicTypeIndex.ttl " ))),
280+ 'storage ' => $ this ->getStorageUrl ($ userId )
281+ );
282+ return $ profile ;
283+ }
282284 }
283285 return false ;
284286 }
@@ -331,4 +333,4 @@ private function generateTurtleProfile($userId) {
331333 $ combinedProfile = $ graph ->serialise ("turtle " );
332334 return $ combinedProfile ;
333335 }
334- }
336+ }
0 commit comments