handled null argument for checkExtension() as IllegalArgumentException
(not null pointer exception)