Added check for data length on resize.

Avoids unnecessary calculations on resize if no data.