check if shortURL is null before throwing exception