preventing crash caused by invalid Array size during indent calculation