File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ std::optional<Config> read_config() {
185185 }
186186
187187 std::ifstream file (cache_home + " /nekoroshell/navbar-hover.conf" );
188+ if (!file.is_open ()) return std::nullopt ;
188189
189190 if (file.is_open ()) {
190191 std::string line;
@@ -211,7 +212,11 @@ int main() {
211212
212213 std::thread (swaync_watcher_thread).detach ();
213214
214- Config cfg = read_config ();
215+ auto result = read_config ();
216+ if (!result) {
217+ return 1 ;
218+ }
219+ Config cfg = *result;
215220 std::vector<Monitor> monitors = backend->get_monitors ();
216221 int cycle_count = 0 ;
217222
@@ -259,7 +264,7 @@ int main() {
259264 }
260265
261266 if (++cycle_count >= 100 ) {
262- cfg = read_config ();
267+ cfg = *result;
263268 monitors = backend->get_monitors ();
264269 cycle_count = 0 ;
265270 }
You can’t perform that action at this time.
0 commit comments