mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 03:33:27 +00:00
Make string replace op safer
This commit is contained in:
parent
de1f33a720
commit
73a45b15ce
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ define [
|
|||
if data.length >= (TWO_MEGABYTES - 200)
|
||||
$scope.textPreview.shouldShowDots = true
|
||||
# remove last partial line
|
||||
data = data.replace(/\n.*$/, '')
|
||||
data = data?.replace?(/\n.*$/, '')
|
||||
$scope.textPreview.data = data
|
||||
$timeout(setHeight, 0)
|
||||
.catch (error) ->
|
||||
|
|
Loading…
Reference in a new issue