Null check protection for a crash when changing dimensions