mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +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 {
|
||||
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) {
|
||||
return data[i];
|
||||
} else {
|
||||
return T();
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue