Don't NPE on invalid dimension ID

Signed-off-by: Ross Allan <rallanpcl@gmail.com>