File tree Expand file tree Collapse file tree
src/Migration/Destinations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1849,15 +1849,20 @@ private function resolveMessageTargets(Message $resource): array
18491849 continue ;
18501850 }
18511851
1852- if (!isset ($ targetCache [$ userId ])) {
1853- $ targetCache [$ userId ] = $ this ->users ->listTargets ($ userId );
1854- }
1852+ try {
1853+ if (!isset ($ targetCache [$ userId ])) {
1854+ $ targetCache [$ userId ] = $ this ->users ->listTargets ($ userId );
1855+ }
18551856
1856- foreach ($ targetCache [$ userId ]['targets ' ] as $ target ) {
1857- if ($ target ['providerType ' ] === $ providerType ) {
1858- $ resolvedTargets [] = $ target ['$id ' ];
1859- break ;
1857+ foreach ($ targetCache [$ userId ]['targets ' ] as $ target ) {
1858+ if ($ target ['providerType ' ] === $ providerType ) {
1859+ $ resolvedTargets [] = $ target ['$id ' ];
1860+ break ;
1861+ }
18601862 }
1863+ } catch (\Throwable $ e ) {
1864+ // Skip targets for users that don't exist on the destination
1865+ continue ;
18611866 }
18621867 }
18631868
@@ -1880,6 +1885,6 @@ private function resolveTargetId(Subscriber $resource): string
18801885 }
18811886 }
18821887
1883- return $ resource ->getTargetId ( );
1888+ throw new \ Exception ( ' No matching target found for subscriber ' . $ resource ->getId () . ' with providerType ' . $ resource -> getProviderType () );
18841889 }
18851890}
You can’t perform that action at this time.
0 commit comments