Fixes crash for draw mode

If user started drawing below the elements, it would crash because of
null reference to element row.