Browse Source

chore: better error reporting after fix for #300

Almamu 1 năm trước cách đây
mục cha
commit
3c334aac29
1 tập tin đã thay đổi với 4 bổ sung và 0 xóa
  1. 4 0
      src/WallpaperEngine/Application/CApplicationContext.cpp

+ 4 - 0
src/WallpaperEngine/Application/CApplicationContext.cpp

@@ -257,6 +257,10 @@ CApplicationContext::CApplicationContext (int argc, char* argv []) :
 
     program.parse_known_args (argc, argv);
 
+    if (this->settings.general.defaultBackground.empty ()) {
+        throw std::runtime_error ("No default background specified. Either --bg/-b or <background id> must be specified");
+    }
+
     this->settings.audio.volume = std::max(0, std::min (this->settings.audio.volume, 128));
     this->settings.screenshot.delay = std::max (0, std::min (this->settings.screenshot.delay, 5));