Not sure off-hand, but that line is where it's determining the new user login redirection url. Can you edit the Login Modules parameters and make sure a URL is set for both Facebook and Joomla login redirection? It shouldn't 'need' to be, but if that fixes it, we can investigate further why it's choking.
I'm assuming you're using 2.1.0 of the login module, if you're using a different version, let me know.