[core] fix null pointer in handleAdapterChange method
[layout] formatting in BaseLayoutManager