catch empty match[2]

fixes passing empty string to getElementById warning.