extent cannot be ``undefined`` here but it can be ``null``, so I should use ``!goog.isNull(extent)`` instead of ``goog.isDef(extent)``.