File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -353,13 +353,16 @@ define_class!(
353353 use std:: path:: PathBuf ;
354354
355355 let pb = sender. draggingPasteboard( ) ;
356+
356357 #[ allow( deprecated) ]
357- let filenames = pb
358- . propertyListForType( unsafe { NSFilenamesPboardType } )
359- . unwrap( )
358+ let property_list = match pb. propertyListForType( unsafe { NSFilenamesPboardType } ) {
359+ Some ( property_list) => property_list,
360+ None => return false . into( ) ,
361+ } ;
362+
363+ let paths = property_list
360364 . downcast:: <NSArray >( )
361- . unwrap( ) ;
362- let paths = filenames
365+ . unwrap( )
363366 . into_iter( )
364367 . map( |file| PathBuf :: from( file. downcast:: <NSString >( ) . unwrap( ) . to_string( ) ) )
365368 . collect( ) ;
@@ -411,13 +414,16 @@ define_class!(
411414 use std:: path:: PathBuf ;
412415
413416 let pb = sender. draggingPasteboard( ) ;
417+
414418 #[ allow( deprecated) ]
415- let filenames = pb
416- . propertyListForType( unsafe { NSFilenamesPboardType } )
417- . unwrap( )
419+ let property_list = match pb. propertyListForType( unsafe { NSFilenamesPboardType } ) {
420+ Some ( property_list) => property_list,
421+ None => return false . into( ) ,
422+ } ;
423+
424+ let paths = property_list
418425 . downcast:: <NSArray >( )
419- . unwrap( ) ;
420- let paths = filenames
426+ . unwrap( )
421427 . into_iter( )
422428 . map( |file| PathBuf :: from( file. downcast:: <NSString >( ) . unwrap( ) . to_string( ) ) )
423429 . collect( ) ;
Original file line number Diff line number Diff line change @@ -274,3 +274,4 @@ changelog entry.
274274- On Web, device events are emitted regardless of cursor type.
275275- On Wayland, ` axis_value120 ` scroll events now generate ` MouseScrollDelta::LineDelta `
276276- On X11, mouse scroll button events no longer cause duplicated ` WindowEvent::MouseWheel ` events.
277+ - On macOS, fixed crash when dragging non-file content onto window.
You can’t perform that action at this time.
0 commit comments