Container: add checks for null in getWidth/Height functions