URL can be null and throw a NullPointerException

This could not be caught in the if-null-then-throw block