Repository navigation
Commit d89e7f4
authored
[beta] [flutter_tools] Guard against null vmService and uiIsolate in debugDumpFocusTree and debugDumpLayerTree (#194741)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
### Issue Link:
#192934
### Impact Description:
In `flutter run` debug sessions, triggering `debugDumpFocusTree` (`f`) or `debugDumpLayerTree` (`t`) when a `FlutterDevice`'s VM service connection or a `FlutterView`'s attached `uiIsolate` is null (such as during isolate initialization or teardown) causes an unhandled `_TypeError: Null check operator used on a null value` crash in `flutter_tools`. This was observed as a top crasher in Flutter 3.47.3 crash telemetry (28 crashes in the first 7 days post-release).
### Changelog Description:
[flutter/192934] When dumping the focus tree or layer tree from `flutter run` on any platform before the UI isolate finishes initializing or after teardown, `flutter_tools` crashed with a null check operator exception.
### Workaround:
Wait until the app and UI isolate have fully initialized before invoking `f` (`debugDumpFocusTree`) or `t` (`debugDumpLayerTree`) in the `flutter run` terminal.
### Risk:
What is the risk level of this cherry-pick?
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
1. Run `flutter test packages/flutter_tools/test/general.shard/terminal_handler_test.dart`.
2. Verify that `debugDumpFocusTree` and `debugDumpLayerTree` return gracefully without throwing when `vmService` or `uiIsolate` is null.1 parent 07502c7 commit d89e7f4
2 files changed
Lines changed: 133 additions & 74 deletions
File tree
- packages/flutter_tools
- lib/src
- test/general.shard
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
629 | 618 | | |
630 | 619 | | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
646 | 624 | | |
647 | 625 | | |
648 | 626 | | |
649 | | - | |
| 627 | + | |
650 | 628 | | |
651 | 629 | | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
662 | 634 | | |
663 | 635 | | |
| 636 | + | |
664 | 637 | | |
665 | | - | |
| 638 | + | |
666 | 639 | | |
667 | 640 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
678 | 645 | | |
679 | 646 | | |
680 | 647 | | |
681 | 648 | | |
682 | 649 | | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
698 | 654 | | |
699 | 655 | | |
700 | 656 | | |
701 | 657 | | |
702 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
703 | 667 | | |
704 | 668 | | |
705 | 669 | | |
| 670 | + | |
706 | 671 | | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
712 | 681 | | |
713 | 682 | | |
714 | | - | |
| 683 | + | |
715 | 684 | | |
716 | 685 | | |
717 | 686 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
415 | 424 | | |
416 | 425 | | |
417 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
418 | 508 | | |
419 | 509 | | |
420 | 510 | | |
| |||
0 commit comments