Browse Source

FileBackup: check for null and removing a debugging print.

pull/3202/head
TheGoddessInari 7 years ago
parent
commit
3da4a439ea
No known key found for this signature in database
GPG Key ID: 1209B1B7632D69A
  1. 4
      app/ux/FileBackup.js

4
app/ux/FileBackup.js

@ -38,16 +38,14 @@ Ext.define('Rambox.ux.FileBackup', {
defaultPath: myDefaultPath, defaultPath: myDefaultPath,
properties: ['openFile'] properties: ['openFile']
}, function(filePaths, bookmarks) { }, function(filePaths, bookmarks) {
if (filePaths.length === 1) { if (filePaths && filePaths.length === 1) {
const filePath = filePaths[0]; const filePath = filePaths[0];
console.log(filePath);
fs.readFile(filePath, function (err, data) { fs.readFile(filePath, function (err, data) {
if (err) { if (err) {
console.log(err); console.log(err);
} }
const services = JSON.parse(data); const services = JSON.parse(data);
if (services) { if (services) {
console.dir(services);
Ext.cq1('app-main').getController().removeAllServices(true, function() { Ext.cq1('app-main').getController().removeAllServices(true, function() {
Ext.each(services, function(s) { Ext.each(services, function(s) {
const service = Ext.create('Rambox.model.Service', s); const service = Ext.create('Rambox.model.Service', s);

Loading…
Cancel
Save