Commit 50fc5709 authored by d9's avatar d9

clear crash in scan for begin end endif

parent e7790297
......@@ -139,6 +139,8 @@ void CountIterator::setActionUpdateCommand(Command * command) {
void CountIterator::start() {
bool hasbegin = false;
// Getting the count controller
if (m_countController == 0) {
return;
......@@ -195,6 +197,7 @@ void CountIterator::start() {
m_sequencesActivated = true;
// Beginning a new block in any case
hasbegin = true;
Sender<ClientCommand>::begin();
// Test boolean to check if there is an error during the iteration
......@@ -207,7 +210,10 @@ void CountIterator::start() {
if (a->toStart == true) {
if (!m_OnError) {
if (a->newBlock) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
if (hasbegin) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
hasbegin = false;
}
m_checkCurrentControllerStatus();
m_removeCurrentControllers();
if (m_OnError) {
......@@ -217,6 +223,7 @@ void CountIterator::start() {
// we can exit between begin and endIf calls
m_exit();
hasbegin = true;
Sender<ClientCommand>::begin();
}
}
......@@ -303,7 +310,10 @@ void CountIterator::start() {
}
Sender<ClientCommand>::endIf(End<ClientCommand> ());
if (hasbegin) {
Sender<ClientCommand>::endIf(End<ClientCommand> ());
hasbegin = false;
}
if (!m_OnError) {
// End of the block (before a count)
m_checkCurrentControllerStatus();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment