diff --git a/daemon/src/main/cpp/logcat.cpp b/daemon/src/main/cpp/logcat.cpp index 716577f9..0c246fe7 100644 --- a/daemon/src/main/cpp/logcat.cpp +++ b/daemon/src/main/cpp/logcat.cpp @@ -268,12 +268,14 @@ void Logcat::EnsureLogWatchDog() { SetStrProp("ctl.start", "logd-reinit"); } const auto *pi = __system_property_find(kLogdTagProp.data()); - uint32_t serial; - __system_property_read_callback(pi, [](auto *c, auto, auto, auto s) { - *reinterpret_cast(c) = s; - }, &serial); + uint32_t serial = 0; + if (pi != nullptr) { + __system_property_read_callback(pi, [](auto *c, auto, auto, auto s) { + *reinterpret_cast(c) = s; + }, &serial); + } if (!__system_property_wait(pi, serial, &serial, nullptr)) break; - Log("\nResetting log settings\n"); + if (pi != nullptr) Log("\nResetting log settings\n"); } }).detach(); }