Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4954

JS State API returns empty object in place of undefined.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.2.0
    • 3.0.1
    • API - Front end
    • None

    Description

      When the state doesn't include the object required, the API currently returns an empty object, instead of null.

      To avoid breaking backwards compatibility where people have done workarounds like if (state.getPullRequest().id) ..., we can't accurately fix this until Stash 4.0.

      In the meantime, we'll return false in place of undefined and null, which will prevent the above workaround from throwing an error. In Stash 4.0 this crutch will be removed and null or undefined will be returned as appropriate.

      Attachments

        Activity

          People

            aahmed Adam Ahmed (Inactive)
            aahmed Adam Ahmed (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: