[iOS][LO] Check sub navigation size before clear

Check the sub_navigation size before erase as the vector might be empty due to unsuccessful navigation.

Bug: None
Change-Id: Id2a3ed2eca7f8bff71c9f71b92818b9db803ce30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6239852
Reviewed-by: Radu Nitescu <radunitescu@google.com>
Commit-Queue: Christian Xu <christianxu@chromium.org>
Auto-Submit: Christian Xu <christianxu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416760}
NOKEYCHECK=True
GitOrigin-RevId: 9925c9c4d1a82a13b0e83fb65dd490f8fe4baa78
1 file changed
tree: b63a6c02318fc629e3d413d3cd43196ca63607fa
  1. build/
  2. chrome/
  3. components/
  4. google_internal/
  5. intents/
  6. net/
  7. public/
  8. testing/
  9. third_party/
  10. tools/
  11. web/
  12. web_view/
  13. .swift-format
  14. BUILD.gn
  15. COMMON_METADATA
  16. DEPS
  17. DIR_METADATA
  18. features.gni
  19. OWNERS
  20. PRESUBMIT.py
  21. PRESUBMIT_test.py
  22. README.md
README.md

This directory holds code related to Chrome for iOS. See this document for a description of the structure underneath this directory.