mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05: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)
|
if data.length >= (TWO_MEGABYTES - 200)
|
||||||
$scope.textPreview.shouldShowDots = true
|
$scope.textPreview.shouldShowDots = true
|
||||||
# remove last partial line
|
# remove last partial line
|
||||||
data = data.replace(/\n.*$/, '')
|
data = data?.replace?(/\n.*$/, '')
|
||||||
$scope.textPreview.data = data
|
$scope.textPreview.data = data
|
||||||
$timeout(setHeight, 0)
|
$timeout(setHeight, 0)
|
||||||
.catch (error) ->
|
.catch (error) ->
|
||||||
|
|
Loading…
Reference in a new issue