Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit e02ce54

Browse files
committed
check if view is available
1 parent 71c4bfa commit e02ce54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Helper/HeadScript.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
400400
$addScriptEscape = !(isset($item->attributes['noescape'])
401401
&& filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));
402402

403-
if ($item->type != '' || $this->view->plugin('doctype')->isXhtml()) {
403+
if ($item->type != '' || ($this->view && $this->view->plugin('doctype')->isXhtml())) {
404404
$type = ($this->autoEscape) ? $this->escape($item->type) : $item->type;
405405
$html = '<script type="' . $type . '"' . $attrString . '>';
406406
} else {

0 commit comments

Comments
 (0)