mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:30:33 +02:00
Avoid to create a route when the source is not defined
This commit is contained in:
parent
9ae1da371e
commit
3d8b7f9d10
3 changed files with 16 additions and 11 deletions
|
@ -300,7 +300,7 @@ namespace controller {
|
|||
const auto& destination = route->_destination;
|
||||
// THis could happen if the route destination failed to create
|
||||
// FIXME: Maybe do not create the route if the destination failed and avoid this case ?
|
||||
if (!destination) {
|
||||
if (!source || !destination) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,9 +39,14 @@ QObject* MappingBuilderProxy::from(const QScriptValue& source) {
|
|||
}
|
||||
|
||||
QObject* MappingBuilderProxy::from(const Endpoint::Pointer& source) {
|
||||
auto route = Route::Pointer(new Route());
|
||||
route->_source = source;
|
||||
return new RouteBuilderProxy(_parent, _mapping, route);
|
||||
if (source) {
|
||||
auto route = Route::Pointer(new Route());
|
||||
route->_source = source;
|
||||
return new RouteBuilderProxy(_parent, _mapping, route);
|
||||
} else {
|
||||
qCDebug(controllers) << "MappingBuilderProxy::from : source is null so no route created";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
QObject* MappingBuilderProxy::makeAxis(const QJSValue& source1, const QJSValue& source2) {
|
||||
|
|
|
@ -108,7 +108,7 @@ bool PolyLineEntityItem::setStrokeWidths(const QVector<float>& strokeWidths) {
|
|||
|
||||
bool PolyLineEntityItem::setNormals(const QVector<glm::vec3>& normals) {
|
||||
_normals = normals;
|
||||
if (_points.size() < 2 || _normals.size() < 2) {
|
||||
if (_points.size() < 2 || _normals.size() < 2 || _strokeWidths.size() < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue