Skip to content

TypeError: Cannot convert null or undefined to object when opening metrics with no completed tasks #4262

Closed
@chaseluikart

Description

@chaseluikart

Your Environment

  • Version used: 12.0.6-rc.2
  • Operating System and version: macOS Monterey 12.7.6

Expected Behavior

The metrics view should open, possibly showing empty statistics or a message indicating no data is available. I think you're using an error message like: "No additional data collected yet. Use the form on the daily summary "Evaluation" panel to do so." elsewhere. (side note for sub-issue: I actually didn't know where this daily summary "Evaluation" panel was & couldn't find it)

Current Behavior

The application crashes with the TypeError described above.

Steps to Reproduce (for bugs)

  1. Create a project with no tasks (or with no completed tasks)
  2. Right-click on the project (or click the three vertical dots menu)
  3. Select "Metrics" from the menu

Can you reproduce this reliably?

Yes, I can reliably reproduce the error.

Console Output

TypeError: Cannot convert undefined or null to object keys
(file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/src/app/features/project/project.service.ts:76:15)_next

(file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/operators/map.js:29:28)next
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/Subscriber.js:50:11)subscriber.add
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/ReplaySubject.js:58:19)_trySubscribe
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/Observable.js:42:20)_trySubscribe
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/Subject.js:87:21)toSubscriber
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/Observable.js:28:136)subject.complete
 (file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/operators/shareReplay.js:52:25)toSubscriber 

(file:///Applications/Super%20Productivity.app/Contents/Resources/app.asar/dist/browser/node_modules/rxjs/_esm2015/internal/Observable.js:26:26)
TypeError: Cannot convert undefined or null to object
    at Object.keys (<anonymous>)
    at mv.project (project.service.ts:76:16)
    at mv._next (map.js:29:29)
    at mv.next (Subscriber.js:50:12)
    at cs.next (Subject.js:42:19)
    at cs.nextInfiniteTimeWindow (ReplaySubject.js:30:11)
    at Object.next (shareReplay.js:36:19)
    at fh.__tryOrUnsub (Subscriber.js:186:10)
    at fh.next (Subscriber.js:126:14)
    at e._next (Subscriber.js:73:22)
global-error-handler.class.ts:26 GLOBAL_ERROR_HANDLER TypeError: Cannot convert undefined or null to object
    at Object.keys (<anonymous>)
    at mv.project (project.service.ts:76:16)
    at mv._next (map.js:29:29)
    at mv.next (Subscriber.js:50:12)
    at cs.next (Subject.js:42:19)
    at cs.nextInfiniteTimeWindow (ReplaySubject.js:30:11)
    at Object.next (shareReplay.js:36:19)
    at fh.__tryOrUnsub (Subscriber.js:186:10)
    at fh.next (Subscriber.js:126:14)
    at e._next (Subscriber.js:73:22)

Error Log (Desktop only)

Additional Info:

The error occurs at line 76 of project.service.ts, likely when attempting to process keys of a null object when no completed tasks exist.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions