Check getInstance() for null

It could happen that Jenkins.getInstance() is null.