Fix url generation when userId is null.
Add defensive coding.
Merge pull request #1 from dgurkaynak/dogar

Fix url generation when userId is null.