Looking at line number 19 and 22 I think that parameter "provider" is required.
Of course it shouldn't fail - throw an Exception in anycase - no matter what params are passed or are not passed.