Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
a71c688d
Commit
a71c688d
authored
Jan 12, 2017
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enclose JSON conversion in try/catch
parent
f36b9d9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
config.js
src/app/config.js
+10
-4
No files found.
src/app/config.js
View file @
a71c688d
...
...
@@ -8,9 +8,12 @@ function Config (storage) {
this
.
items
=
{}
// load on instantiation
var
config
=
storage
.
get
(
CONFIG_FILE
)
if
(
config
)
{
this
.
items
=
JSON
.
parse
(
config
)
try
{
var
config
=
storage
.
get
(
CONFIG_FILE
)
if
(
config
)
{
this
.
items
=
JSON
.
parse
(
config
)
}
}
catch
(
exception
)
{
}
this
.
exists
=
function
(
key
)
{
...
...
@@ -23,7 +26,10 @@ function Config (storage) {
this
.
set
=
function
(
key
,
content
)
{
this
.
items
[
key
]
=
content
storage
.
set
(
CONFIG_FILE
,
JSON
.
stringify
(
this
.
items
))
try
{
storage
.
set
(
CONFIG_FILE
,
JSON
.
stringify
(
this
.
items
))
}
catch
(
exception
)
{
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment