File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ - (void)openURL:(NSString*) url inBrowserTarget:(BrowserTarget) browserTarget an
4848 SafariWindow* frontWindow = [[application windows ] firstObject ];
4949 SafariTab* newTab = [[[application classForScriptingClass: @" tab" ] alloc ] init ];
5050 [[frontWindow tabs ] addObject: newTab];
51- frontWindow.currentTab = newTab;
52- newTab.URL = url;
51+ // don't touch `newTab` after adding it to `tabs` - it was causing a crash
52+ frontWindow.currentTab = frontWindow.tabs .lastObject ;
53+ frontWindow.currentTab .URL = url;
5354 break ;
5455 }
5556 default : {
Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ - (void)openURL:(NSString*) url inBrowserTarget:(BrowserTarget) browserTarget an
4848 SafariTechnologyPreviewWindow* frontWindow = [[application windows ] firstObject ];
4949 SafariTechnologyPreviewTab* newTab = [[[application classForScriptingClass: @" tab" ] alloc ] init ];
5050 [[frontWindow tabs ] addObject: newTab];
51- frontWindow.currentTab = newTab;
52- frontWindow.tabs .lastObject .URL = url;
51+ // don't touch `newTab` after adding it to `tabs` - it was causing a crash
52+ frontWindow.currentTab = frontWindow.tabs .lastObject ;
53+ frontWindow.currentTab .URL = url;
5354 break ;
5455 }
5556 default : {
You can’t perform that action at this time.
0 commit comments