Fix endless loop if adapter is set and has less items than previous adapter