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 (semanticScope.getCondition(userStringNode, Read.class) == false) {
            throw userStringNode.createError(new IllegalArgumentException("not a statement: string constant [" + string + "] not used"));
        }
        semanticScope.putDecoration(userStringNode, new ValueType(String.class));
        semanticScope.putDecoration(userStringNode, new StandardConstant(string));
    }
    /**
     * Visits a null constant expression.
     * Checks: type validation
     */
    @Override
    public void visitNull(ENull userNullNode, SemanticScope semanticScope) {
        if (semanticScope.getCondition(userNullNode, Write.class)) {
            throw userNullNode.createError(new IllegalArgumentException("invalid assignment: cannot assign a value to null constant"));
        }
        if (semanticScope.getCondition(userNullNode, Read.class) == false) {
            throw userNullNode.createError(new IllegalArgumentException("not a statement: null constant not used"));
        }
        TargetType targetType = semanticScope.getDecoration(userNullNode, TargetType.class);
        Class<?> valueType;
        if (targetType != null) {
            if (targetType.targetType().isPrimitive()) {
                throw userNullNode.createError(
                    new IllegalArgumentException("Cannot cast null to a primitive type [" + targetType.getTargetCanonicalTypeName() + "].")
                );
            }
            valueType = targetType.targetType();
        } else {