From 8c32a683fe97572cd3897b2e9c514bba6ecb1e7d Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Tue, 18 Mar 2025 16:49:48 +0800 Subject: [PATCH] bug: fix codex Signed-off-by: lyj_love_code --- hiview_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hiview_file.c b/hiview_file.c index cb7ec0f..ba06a01 100644 --- a/hiview_file.c +++ b/hiview_file.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Huawei Device Co., Ltd. + * Copyright (c) 2020-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -312,6 +312,9 @@ void RegisterFileWatcher(HiviewFile *fp, FileProc func, const char *path) void UnRegisterFileWatcher(HiviewFile *fp, FileProc func) { + if (fp == NULL || func == NULL) { + return; + } (void)func; fp->pFunc = NULL; if (IsValidPath(fp->outPath) == 0) {