Jquery on click when no network id

Started the process of restricting access to site features when user is
not in a network. Currently getting an error because no table exists
called NULL. Once restricted, any clicked link will result in a pop up
box prompting user to join/create a network