mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
Fix binding to temporary when trying to safely get empty model-baker task data
This commit is contained in:
parent
4ae0c79130
commit
9c9dc553a2
1 changed files with 4 additions and 2 deletions
|
@ -15,11 +15,13 @@
|
||||||
|
|
||||||
namespace baker {
|
namespace baker {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T safeGet(const std::vector<T>& data, size_t i) {
|
const T& safeGet(const std::vector<T>& data, size_t i) {
|
||||||
|
static T t;
|
||||||
|
|
||||||
if (data.size() > i) {
|
if (data.size() > i) {
|
||||||
return data[i];
|
return data[i];
|
||||||
} else {
|
} else {
|
||||||
return T();
|
return t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue