code: private static QName variableTypeRefOrErrIfNull(DMNModelImpl model, InformationItem variable) {
          if ( variable.getTypeRef() != null ) {
              return variable.getTypeRef();
          } else {
              MsgUtil.reportMessage( logger,
                      DMNMessage.Severity.ERROR,
                      variable,
                      model,
                      null,
                      null,
                      Msg.MISSING_TYPEREF_FOR_VARIABLE,
                      variable.getName(),
                      variable.getParentDRDElement().getIdentifierString() );
              return null;
          }
      }
docs: Utility method to have a error message is reported if a DMN Variable is missing typeRef.
  @param model used for reporting errors
  @param variable the variable to extract typeRef
  @return the `variable.typeRef` or null in case of errors. Errors are reported with standard notification mechanism via MsgUtil.reportMessage