mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 10:07:38 -04:00
theme_menu: Error out gracefully when a directory doesn't exist
Normally we can't browse into a directory that doesn't exist; hwoever the theme menu lets us directly browse (eg) fonts, themes, etc. If the target directory is not present (due to a broken installation) we actually crash! So, um, check and bail gracefully. Should fix FS#13636 Change-Id: Idb28c55cf0ce3954114d056725f9992ceaf1db20
This commit is contained in:
parent
9265d43a56
commit
c145f41658
1 changed files with 7 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "settings.h"
|
||||
#include "rbpaths.h"
|
||||
#include "menu.h"
|
||||
#include "dir.h"
|
||||
#include "tree.h"
|
||||
#include "list.h"
|
||||
#include "color_picker.h"
|
||||
|
@ -42,6 +43,7 @@
|
|||
#include "viewport.h"
|
||||
#include "statusbar-skinned.h"
|
||||
#include "skin_engine/skin_engine.h"
|
||||
#include "splash.h"
|
||||
#include "icons.h"
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
#include "filetypes.h"
|
||||
|
@ -258,6 +260,11 @@ int browse_folder(void *param)
|
|||
.root = info->dir,
|
||||
};
|
||||
|
||||
if (!dir_exists(info->dir)) {
|
||||
splash(HZ, ID2P(LANG_PLAYLIST_DIRECTORY_ACCESS_ERROR));
|
||||
return GO_TO_PREVIOUS;
|
||||
}
|
||||
|
||||
/* if we are in a special settings folder, center the current setting */
|
||||
switch(info->show_options)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue