[fix] secure fix, to prevent access to undefined array index 
Signed-off-by:Damian Zajkowski <damian.zajkowski@rst.com.pl>