Browse Source

meta: if it's initialized, it's ok

Michele Caini 1 year ago
parent
commit
e343a24966
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/entt/meta/meta.hpp

+ 1 - 1
src/entt/meta/meta.hpp

@@ -1304,7 +1304,7 @@ public:
      */
      */
     [[nodiscard]] bool can_cast(const meta_type &other) const noexcept {
     [[nodiscard]] bool can_cast(const meta_type &other) const noexcept {
         // casting this is UB in all cases but we aren't going to use the resulting pointer, so...
         // casting this is UB in all cases but we aren't going to use the resulting pointer, so...
-        return (other.node.info != nullptr) && (internal::try_cast(internal::meta_context::from(*ctx), node, *other.node.info, this) != nullptr);
+        return other && (internal::try_cast(internal::meta_context::from(*ctx), node, *other.node.info, this) != nullptr);
     }
     }
 
 
     /**
     /**