Uploaded image for project: 'libdiscid'
  1. libdiscid
  2. LIB-48

Fix asserts/return values on empty object

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: libdiscid 0.2.2, libdiscid 0.5.1
    • Fix Version/s: libdiscid 0.6.0
    • Labels:
      None

      Description

      When not having done a read() or put() some attributes like the ID have undefined behavior.

      For discid_get_id() we have an assertion in debug builds and return NULL in release/normal builds.
      We shouldn't have assertion errors in anything the user can produce (debug build or not) when we can recover normally.

      Returning the empty string is an option in this case.

      At lest the current behavior should be mentioned in the documentation.

        Attachments

          Activity

            People

            Assignee:
            jonnyjd Johannes Dewender
            Reporter:
            jonnyjd Johannes Dewender
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                libdiscid 0.6.0