File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
src/Files.App/Views/LayoutModes Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,13 @@ protected override void EndRename(TextBox textBox)
180
180
textBlock ! . Visibility = Visibility . Visible ;
181
181
}
182
182
183
- textBox ! . LostFocus -= RenameTextBox_LostFocus ;
184
- textBox . KeyDown -= RenameTextBox_KeyDown ;
183
+ // Unsubscribe from events
184
+ if ( textBox is not null )
185
+ {
186
+ textBox ! . LostFocus -= RenameTextBox_LostFocus ;
187
+ textBox . KeyDown -= RenameTextBox_KeyDown ;
188
+ }
189
+
185
190
FileNameTeachingTip . IsOpen = false ;
186
191
IsRenamingItem = false ;
187
192
}
Original file line number Diff line number Diff line change @@ -311,8 +311,13 @@ protected override void EndRename(TextBox textBox)
311
311
textBlock ! . Visibility = Visibility . Visible ;
312
312
}
313
313
314
- textBox ! . LostFocus -= RenameTextBox_LostFocus ;
315
- textBox . KeyDown -= RenameTextBox_KeyDown ;
314
+ // Unsubscribe from events
315
+ if ( textBox is not null )
316
+ {
317
+ textBox ! . LostFocus -= RenameTextBox_LostFocus ;
318
+ textBox . KeyDown -= RenameTextBox_KeyDown ;
319
+ }
320
+
316
321
FileNameTeachingTip . IsOpen = false ;
317
322
IsRenamingItem = false ;
318
323
Original file line number Diff line number Diff line change @@ -250,8 +250,13 @@ protected override void EndRename(TextBox textBox)
250
250
textBlock ! . Visibility = Visibility . Visible ;
251
251
}
252
252
253
- textBox ! . LostFocus -= RenameTextBox_LostFocus ;
254
- textBox . KeyDown -= RenameTextBox_KeyDown ;
253
+ // Unsubscribe from events
254
+ if ( textBox is not null )
255
+ {
256
+ textBox ! . LostFocus -= RenameTextBox_LostFocus ;
257
+ textBox . KeyDown -= RenameTextBox_KeyDown ;
258
+ }
259
+
255
260
FileNameTeachingTip . IsOpen = false ;
256
261
IsRenamingItem = false ;
257
262
You can’t perform that action at this time.
0 commit comments