IBM Support

IT39979: .NET CORE: SYSTEM.NULLREFERENCEEXCEPTION THROWN CALLING GETDECIMAL()

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When making a call to GetDecimal(), the following exception can
    be seen:
    
    D:\Infx\work\cs\core\p>dotnet run
    [ERROR] - Type: System.NullReferenceException - Message: Object
    reference not set to an instance of an object. - Stack Trace:
    at Informix.Net.Core.IfxDataReader.GetDecimal(Int32 i)
    
    using System;
    using System.IO;
    using System.Data;
    using System.Text;
    using Informix.Net.Core;
    using System.Globalization;
    
    namespace MyConsoleApp
    {
        class Program
        {
            static void Main(string[] args)
            {
             CultureInfo.DefaultThreadCurrentCulture =
    CultureInfo.CreateSpecificCulture("de-DE");
    
    IfxConnection conn;
    try {
      conn = new
    IfxConnection("server=ids1410;database=sysmaster;");
      conn.Open();
      IfxCommand ifxcmd = conn.CreateCommand();
      IfxCommand cmmd = conn.CreateCommand();
      cmmd.CommandText = "SELECT '1.0'::decimal";
      IfxDataReader drdr;
      drdr = cmmd.ExecuteReader();
      while (drdr.Read())
               {
                   if (drdr.IsDBNull(0))
                       Console.WriteLine("null");
    
                    else
                       Console.WriteLine($"\tGetDecimal:
    {drdr.GetDecimal(0)}");
               }
      drdr.Close();
      conn.Close();
     }
              catch (Exception ex)
              {
                Console.Error.WriteLine($"[ERROR] - Type:
    {ex.GetType()} - Message: {ex.Message} - Stack Trace:
    {ex.StackTrace}");
              }
            }
        }
    }
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Users of Informix Client SDK prior to version 4.50.FC8.      *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Informix Client SDK 4.50.FC8.                     *
    ****************************************************************
    

Problem conclusion

  • Fixed in Informix Client SDK 4.50.FC8.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT39979

  • Reported component name

    IBM CSDK

  • Reported component ID

    5724C2381

  • Reported release

    450

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2022-02-15

  • Closed date

    2022-04-07

  • Last modified date

    2022-04-07

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    IBM CSDK

  • Fixed component ID

    5724C2381

Applicable component levels

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSVT2J","label":"Informix Tools"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"450"}]

Document Information

Modified date:
08 April 2022