mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
FIxing the compil bug by checking security of the call with assert and avoiding the compilation error
This commit is contained in:
parent
a60ef4fb5a
commit
1364329886
1 changed files with 4 additions and 10 deletions
|
@ -86,19 +86,13 @@ public:
|
||||||
|
|
||||||
template <class T> T& edit() {
|
template <class T> T& edit() {
|
||||||
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
|
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
|
||||||
if (theConcept) {
|
assert(theConcept);
|
||||||
return theConcept->_data;
|
return theConcept->_data;
|
||||||
}
|
|
||||||
assert(false);
|
|
||||||
return T();
|
|
||||||
}
|
}
|
||||||
template <class T> const T& get() const {
|
template <class T> const T& get() const {
|
||||||
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
|
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
|
||||||
if (theConcept) {
|
assert(theConcept);
|
||||||
return theConcept->_data;
|
return theConcept->_data;
|
||||||
}
|
|
||||||
assert(false);
|
|
||||||
return T();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
|
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {
|
||||||
|
|
Loading…
Reference in a new issue