mirror of
https://github.com/filp/whoops.git
synced 2026-08-30 12:07:25 +00:00
Prevent javascript error: "TypeError: can't access property "scrollIntoView", line is undefined" (#776)
This commit is contained in:
@@ -43,8 +43,11 @@ Zepto(function($) {
|
||||
});
|
||||
|
||||
var line = $activeFrame.find('.code-block .line-highlight').first()[0];
|
||||
line.scrollIntoView();
|
||||
line.parentElement.scrollTop -= 180;
|
||||
// [internal] frames might not contain a code-block
|
||||
if (line) {
|
||||
line.scrollIntoView();
|
||||
line.parentElement.scrollTop -= 180;
|
||||
}
|
||||
|
||||
$container.scrollTop(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user