Additionally check for null on registring Servlets and Filters

See gh-482