The NOTICE was that if they click on a link domain.com/user/nonexistentuser, the function was returning null, there is no ID for nonexistent users (cannot get ID from null), that was the NOTICE. In the new code we assign 0 as default value for nonexisting users to avoid this issue, that's the only thing we are doing in there.
This line of code, has nothing to do with if the user is admin or not, it is just getting the ID of the current profile url that is being accessed by everybody (before the authorization checking, the admin checking is in the code below that).
Senior Developer.