diff --git a/js/glowingbear.js b/js/glowingbear.js index f682e0b..5815f03 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1593,7 +1593,9 @@ weechat.directive('inputBar', function() { // Set cursor to last position. Need 0ms timeout because browser sets cursor // position to the beginning after this key handler returns. setTimeout(function() { - inputNode.setSelectionRange($scope.command.length, $scope.command.length); + if ($scope.command) { + inputNode.setSelectionRange($scope.command.length, $scope.command.length); + } }, 0); return true; }