Skip to content

Commit

Permalink
Fix bug in manifest loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansturmer committed Oct 28, 2016
1 parent 2e05811 commit 5993541
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fmp/fmp.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ function executeOperations(manifest) {
function clearToken(manifest) {
var deferred = Q.defer();

if(manifest.token) {
if(!manifest) { deferred.reject(new Error('No manifest was provided.')); }
else if(manifest.token) {
log.info('Clearing update token ' + manifest.token)
fs.unlink(manifest.token, function(err) {
// err is swallowed on purpose. It's ok if this operation fails due to the file not existing
Expand All @@ -232,7 +233,8 @@ function clearToken(manifest) {
function setToken(manifest) {
var deferred = Q.defer();

if(manifest.token) {
if(!manifest) { deferred.reject(new Error('No manifest was provided.')); }
else if(manifest.token) {
log.info('Setting update token ' + manifest.token)
fs.writeFile(manifest.token, "", function(err) {
if(err) {
Expand Down Expand Up @@ -342,6 +344,7 @@ function installUnpackedPackage(manifest_filename) {
return loadManifest(manifest_filename)
.then(function(m) {
manifest = m;
return m;
})
.then(stopServices)
.then(unlock)
Expand Down

0 comments on commit 5993541

Please sign in to comment.