mirror of
https://github.com/atom/atom.git
synced 2026-02-05 20:25:04 -05:00
Don't allow float or int Editor's to have NaN as a value
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
cedea831f7
commit
ecad6bc2a8
@@ -32,6 +32,7 @@ class ConfigPanel extends View
|
||||
|
||||
bindEditors: ->
|
||||
for editor in @find('.editor[id]').views()
|
||||
console.log editor
|
||||
do (editor) =>
|
||||
name = editor.attr('id')
|
||||
type = editor.attr('type')
|
||||
@@ -41,6 +42,6 @@ class ConfigPanel extends View
|
||||
|
||||
editor.getBuffer().on 'contents-modified', ->
|
||||
value = editor.getText()
|
||||
if type == 'int' then value = parseInt(value)
|
||||
if type == 'float' then value = parseFloat(value)
|
||||
if type == 'int' then value = parseInt(value) or 0
|
||||
if type == 'float' then value = parseFloat(value) or 0
|
||||
config.set name, value
|
||||
|
||||
Reference in New Issue
Block a user