Commit 67cec741e5f22c0ca4e95c1074e5f24a36d95889
1 parent
313bd10d
Stream project(Template,Template) won't crash if the destination templatelist wi…
…thin the function is empty
Showing
1 changed file
with
2 additions
and
2 deletions
openbr/plugins/stream.cpp
| ... | ... | @@ -1315,7 +1315,7 @@ public: |
| 1315 | 1315 | in.append(src); |
| 1316 | 1316 | TemplateList out; |
| 1317 | 1317 | CompositeTransform::project(in,out); |
| 1318 | - dst = out.first(); | |
| 1318 | + if (!out.isEmpty()) dst = out.first(); | |
| 1319 | 1319 | if (out.size() > 1) |
| 1320 | 1320 | qDebug("Returning first output template only"); |
| 1321 | 1321 | } |
| ... | ... | @@ -1326,7 +1326,7 @@ public: |
| 1326 | 1326 | in.append(src); |
| 1327 | 1327 | TemplateList out; |
| 1328 | 1328 | projectUpdate(in,out); |
| 1329 | - dst = out.first(); | |
| 1329 | + if (!out.isEmpty()) dst = out.first(); | |
| 1330 | 1330 | if (out.size() > 1) |
| 1331 | 1331 | qDebug("Returning first output template only"); |
| 1332 | 1332 | } | ... | ... |