JS State API returns empty object in place of undefined.

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 3.2.0
    • Affects Version/s: 3.0.1
    • Component/s: API - Front end
    • None

      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.

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

              Created:
              Updated:
              Resolved: