Add a null check on method here, since that's what safeGetMethod will return if it fails.