Permalink
Browse files

Making dependency checks more test-friendly in `Html` helper.

  • Loading branch information...
1 parent d414e4a commit 7e42ea7d611824c97a920df40ba1bd81d4a56a73 @nateabele nateabele committed Jul 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 template/helper/Html.php
View
@@ -110,7 +110,9 @@ class Html extends \lithium\template\Helper {
* @return string A meta tag containing the specified encoding (literally).
*/
public function charset($encoding = null) {
- $encoding = $encoding ?: $this->_context->response()->encoding;
+ if ($response = $this->_context->response()) {
+ $encoding = $encoding ?: $response->encoding;
+ }
return $this->_render(__METHOD__, 'charset', compact('encoding'));
}

0 comments on commit 7e42ea7

Please sign in to comment.