Skip to content

Commit 9a55e39

Browse files
committed
Add promise rejection to resume method if there's no project set
1 parent 3f49200 commit 9a55e39

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/include/tasks.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,13 @@ class tasks {
180180
*/
181181
resume() {
182182
return new Promise((resolve, reject) => {
183-
let frames = new FrameCollection(this.config);
183+
let project = this.config.get('project'),
184+
frames = new FrameCollection(this.config);
185+
186+
if (!project) return reject("No project set.");
184187

185188
frames
186-
.filter(frame => frame.project === this.config.get('project'))
189+
.filter(frame => frame.project === project)
187190
.sort((a, b) => moment(a.stop).isBefore(moment(b.stop)) ? 1 : -1);
188191

189192
let last = frames.frames[0];

0 commit comments

Comments
 (0)