summaryrefslogtreecommitdiff
path: root/src/app_console
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-05-24 07:17:42 +1000
committerjacqueline <me@jacqueline.id.au>2023-05-24 07:17:42 +1000
commit876e5e70e93e3031e2acb32ddedc3b262d737ded (patch)
tree10daaad1eb3a14ce7a7b252f59b2c81e41da1b7e /src/app_console
parentebcdf939305879c7061d77fe3cc5cbbd14a3853f (diff)
downloadtangara-fw-876e5e70e93e3031e2acb32ddedc3b262d737ded.tar.gz
Don't crash if there's no sd card
Diffstat (limited to 'src/app_console')
-rw-r--r--src/app_console/app_console.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp
index 80b8a856..95b8881e 100644
--- a/src/app_console/app_console.cpp
+++ b/src/app_console/app_console.cpp
@@ -27,6 +27,12 @@ int CmdListDir(int argc, char** argv) {
return 1;
}
+ auto lock = sInstance->database_.lock();
+ if (lock == nullptr) {
+ std::cout << "storage is not available" << std::endl;
+ return 1;
+ }
+
std::string path;
if (argc == 2) {
path = toSdPath(argv[1]);