Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 64272a5

Browse files
committed
fix a bug that app crashes when deleting profiles
1 parent a707dc8 commit 64272a5

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

V2RayX/ConfigWindowController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
@property (weak) IBOutlet NSTextField *wsPathField;
4646

4747

48-
@property (nonatomic, weak) ServerProfile* selectedProfile;
48+
@property (nonatomic) ServerProfile* selectedProfile;
4949
@property NSInteger selectedServerIndex;
5050
@property NSInteger localPort;
5151
@property BOOL udpSupport;

V2RayX/ConfigWindowController.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@ - (IBAction)addRemoveServer:(id)sender {
7575
NSInteger originalSelectedServerIndex = [_profileTable selectedRow];
7676
[profiles removeObjectAtIndex:originalSelectedServerIndex];
7777
if ([profiles count] > 0) {
78-
/*
79-
if (originalSelectedServerIndex < [profiles count]) {
80-
[_profileTable selectRowIndexes:[NSIndexSet indexSetWithIndex:originalSelectedServerIndex] byExtendingSelection:NO];
81-
} else {
82-
[_profileTable selectRowIndexes:[NSIndexSet indexSetWithIndex:([profiles count] - 1)] byExtendingSelection:NO];
83-
}*/
8478
if (originalSelectedServerIndex == [profiles count]) {//deleted the last server
8579
//select the last server of the remains
8680
[self setSelectedServerIndex:[profiles count] - 1];

0 commit comments

Comments
 (0)