From 50a9a8bfcb76a802031c1df980d82468863ac82c Mon Sep 17 00:00:00 2001 From: Callum Law Date: Tue, 17 Feb 2026 22:54:22 +1300 Subject: [PATCH] AK: Allow comparing `ValueComparingRefPtr` with `nullptr` --- AK/ValueComparingRefPtr.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AK/ValueComparingRefPtr.h b/AK/ValueComparingRefPtr.h index d54dc2513f..2445b3682c 100644 --- a/AK/ValueComparingRefPtr.h +++ b/AK/ValueComparingRefPtr.h @@ -58,6 +58,11 @@ struct ValueComparingRefPtr : public RefPtr { return this->ptr() == other.ptr() || (this->ptr() && other.ptr() && this->ptr()->equals(*other)); } + bool operator==(nullptr_t) const + { + return this->is_null(); + } + private: using RefPtr::operator==; };