Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-163

Missing datatype can throw null pointer exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • DataMapper 1.5
    • DataMapper 1.5
    • DataMapper
    • None

    Description

      When using a numeric type that does not match a registred type, it's possible for the * to remain null. Then, at ResultProperty line 398 (build #412814, et seq.), the _typeHandler can be called directly

      • value = _typeHandler.GetValueByIndex(this, dataReader);

      This causes a deep null pointer exception that is difficult to trace.

      We should patch this with a null guard that throws an exception with a meaningful message, like "Handler for DataType not registered." Something to considerr would be to attach the exception message to the TypeHandler property., and then use the property rather than the private field.

      -Ted.

      Attachments

        Activity

          People

            Unassigned Unassigned
            husted Ted Husted
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: