Selaa lähdekoodia

Fixing bug in

Signed-off-by: Michał Pełka <[email protected]>
Michał Pełka 2 vuotta sitten
vanhempi
commit
1647fc341e

+ 1 - 0
Gems/ROS2/Code/Source/Frame/ROS2FrameComponent.h

@@ -9,6 +9,7 @@
 
 #include "Frame/NamespaceConfiguration.h"
 #include "Frame/ROS2Transform.h"
+#include "ROS2GemUtilities.h"
 #include <AzCore/Component/Component.h>
 #include <AzCore/std/smart_ptr/unique_ptr.h>
 #include <AzFramework/Components/TransformComponent.h>

+ 2 - 0
Gems/ROS2/Code/Source/ROS2GemUtilities.cpp

@@ -5,9 +5,11 @@
  * SPDX-License-Identifier: Apache-2.0 OR MIT
  *
  */
+
 #include "ROS2GemUtilities.h"
 #include <AzCore/std/string/regex.h>
 #include <AzToolsFramework/API/EntityCompositionRequestBus.h>
+
 namespace ROS2
 {
 

+ 2 - 2
Gems/ROS2/Code/Source/ROS2GemUtilities.h

@@ -37,9 +37,9 @@ namespace ROS2
             }
             // failed to get game object, let us retry as editor
             component = AzToolsFramework::FindWrappedComponentForEntity<ComponentType>(entity);
-            AZ_Assert(entity, "Enitity %s has no component of type", entity->GetId());
+            AZ_Assert(entity, "Entity %s has no component of type", entity->GetId());
             // no component found
-            return nullptr;
+            return component;
         }
 
     } // namespace Utils

+ 1 - 0
Gems/ROS2/Code/Source/Sensor/ROS2SensorComponent.h

@@ -7,6 +7,7 @@
  */
 #pragma once
 
+#include "ROS2GemUtilities.h"
 #include "SensorConfiguration.h"
 #include <AzCore/Component/Component.h>
 #include <AzCore/Component/TickBus.h>