Skip to content

Commit

Permalink
Merge branch 'segment' of ssh://bitbucket.org/barracksiot/barracks-cl…
Browse files Browse the repository at this point in the history
…i into segment
  • Loading branch information
bargenson committed Feb 2, 2017
2 parents a746174 + 381b564 commit 83991ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/barracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ program
.command('devices', 'List devices')
.command('device', 'Get device history')
.command('segments', 'Get active and inactive segments')
.command('set-active-segments', 'Get active and inactive segments')
.command('set-active-segments', 'Set active segments in priority order')
.parse(process.argv);

process.on('SIGINT', () => {
Expand Down
4 changes: 2 additions & 2 deletions renderers/jsonRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function write(content) {

module.exports = promise => new Promise(resolve => {
promise.then(result => {
if (result.constructor.name === 'PageableStream') {
if (result && result.constructor.name === 'PageableStream') {
let firstPage = true;
write('[');
result.onPageReceived(page => {
Expand All @@ -17,7 +17,7 @@ module.exports = promise => new Promise(resolve => {
result.onLastPage(() => {
write(']');
});
} else {
} else if (result) {
write(JSON.stringify(result));
}
resolve();
Expand Down

0 comments on commit 83991ed

Please sign in to comment.