HomePhorge

Fix Javascript busy loop when trying to delete tokens from an empty tokenizer

Description

Fix Javascript busy loop when trying to delete tokens from an empty tokenizer

Summary:
Fixes T13147. In D19437, I changed this logic to support deleting the "" (empty string) token, but [].pop() returns undefined, not null, if the list is empty and I didn't think to try deleting an empty input.

Fix the logic so we don't end up in a loop if the input is empty.

Test Plan:

  • In any browser, deleted all tokens in a tokenizer; then pressed delete again.
  • Before: tab hangs in an infinte loop.
  • After: smooth sailing.

Reviewers: amckinley, avivey

Reviewed By: avivey

Maniphest Tasks: T13147

Differential Revision: https://secure.phabricator.com/D19456

Details

Provenance
epriestleyAuthored on Jun 1 2018, 1:05 PM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rP2f6784ee1c41: Add workflow to create repository identities
Branches
Unknown
Tags
Unknown

Event Timeline