فهرست منبع

Handle furi_open() error

Vadim Kaushan 5 سال پیش
والد
کامیت
449e905f46
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      core/tty_uart.c

+ 3 - 0
core/tty_uart.c

@@ -13,6 +13,9 @@ static ssize_t stdout_write(void *_cookie, const char *buf, size_t n) {
     FuriRecordSubscriber *log = pvTaskGetThreadLocalStoragePointer(NULL, 0);
     FuriRecordSubscriber *log = pvTaskGetThreadLocalStoragePointer(NULL, 0);
     if (log == NULL) {
     if (log == NULL) {
         log = furi_open("tty", false, false, NULL, NULL, NULL);
         log = furi_open("tty", false, false, NULL, NULL, NULL);
+        if (log == NULL) {
+            return -1;
+        }
         vTaskSetThreadLocalStoragePointer(NULL, 0, log);
         vTaskSetThreadLocalStoragePointer(NULL, 0, log);
     }
     }
     if (buf == 0) {
     if (buf == 0) {