[Core] Added missing bounds check in loop.

Missing bounds check for extra iterator increment in loop was added.

Signed-off-by: Daniel S. Reichenbach <daniel@kogitoapp.com>