Fix a bug in isLock function.

Signed-off-by: khxkhx321 <khxkhx321@163.com>