From 2895258e08f5dce58a1ecaa7b84aad5724eec2d8 Mon Sep 17 00:00:00 2001 From: Nat Weiss Date: Wed, 9 Mar 2016 22:38:12 -0800 Subject: [PATCH] Proper checking for nullptr rather than implicitly converting to bool. --- EntityFu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EntityFu.h b/EntityFu.h index 027dc95..842559c 100644 --- a/EntityFu.h +++ b/EntityFu.h @@ -113,7 +113,8 @@ class Entity /// Get a guaranteed reference to a component. template static ComponentClass& ref(ComponentClass* p) { - if (p) return *p; + if (p != nullptr) + return *p; static ComponentClass s; return s; }