Skip to content

Commit

Permalink
Proper checking for nullptr rather than implicitly converting to bool.
Browse files Browse the repository at this point in the history
  • Loading branch information
NatWeiss committed Mar 10, 2016
1 parent 313c743 commit 2895258
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EntityFu.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ class Entity
/// Get a guaranteed reference to a component.
template<class ComponentClass> static ComponentClass& ref(ComponentClass* p)
{
if (p) return *p;
if (p != nullptr)
return *p;
static ComponentClass s;
return s;
}
Expand Down

0 comments on commit 2895258

Please sign in to comment.