I got an unexpected internal NPE when playing with this script.

```
POST _scripts/painless/_execute
{
  "script": {
    "source": """
    return /[^\w]+/.split('abc   def higkln').toArray(String[]::new)
    """
  }
}
```
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "compile error",
        "script_stack" : [ ],
        "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
        "lang" : "painless"
      }
    ],
    "type" : "script_exception",
    "reason" : "compile error",
    "script_stack" : [ ],
    "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
    "lang" : "painless",
    "caused_by" : {
      "type" : "null_pointer_exception",
      "reason" : "Cannot read field \"annotations\" because the return value of \"org.elasticsearch.painless.lookup.PainlessLookup.lookupPainlessClass(java.lang.Class)\" is null"
    }
  },
  "status" : 400
}

```
modules/lang-painless/src/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java
if (type == null) {
            throw userCatchNode.createError(
                new IllegalArgumentException("invalid catch declaration: cannot resolve type [" + canonicalTypeName + "]")
            );
        }
        Location location = userCatchNode.getLocation();
        Variable variable = semanticScope.defineVariable(location, type, symbol, false);
        semanticScope.putDecoration(userCatchNode, new SemanticVariable(variable));
        Class<?> baseException = userCatchNode.getBaseException();
        if (userCatchNode.getBaseException().isAssignableFrom(type) == false) {
            throw userCatchNode.createError(
                new ClassCastException(
                    "cannot cast from ["
                        + PainlessLookupUtility.typeToCanonicalTypeName(type)
                        + "] "
                        + "to ["
                        + PainlessLookupUtility.typeToCanonicalTypeName(baseException)
                        + "]"
                )
            );
        }
        SBlock userBlockNode = userCatchNode.getBlockNode();
        if (userBlockNode != null) {
            semanticScope.replicateCondition(userCatchNode, userBlockNode, LastSource.class);
            semanticScope.replicateCondition(userCatchNode, userBlockNode, InLoop.class);
            semanticScope.replicateCondition(userCatchNode, userBlockNode, LastLoop.class);
            visit(userBlockNode, semanticScope);
            semanticScope.replicateCondition(userBlockNode, userCatchNode, MethodEscape.class);
            semanticScope.replicateCondition(userBlockNode, userCatchNode, LoopEscape.class);
            semanticScope.replicateCondition(userBlockNode, userCatchNode, AllEscape.class);