Skip to content

TypeError: 'NoneType' object is not subscriptable #21

Description

@m-jonas

Hi,

First of all let me tell you - I love your work, this tool is brilliant!

I am having an error when running following command: python.exe .\keep-presence.py -s 30 -p 5 -m both -c on Windows 11, using Python 3.10 and running 'main' branch code which is identical with v1.0.7 tag.

10:20:49 User activity detected
--------
10:21:19 Idle detection
Traceback (most recent call last):
  File "C:\Users\XXXX\OneDrive - XXXX\Documents\repositories\keep-presence\src\keep-presence.py", line 175, in <module>
    execute_keep_awake_action()
  File "C:\Users\XXX\OneDrive - XXXX\Documents\repositories\keep-presence\src\keep-presence.py", line 157, in execute_keep_awake_action
    move_mouse()
  File "C:\Users\XXXX\OneDrive - XXXX\Documents\repositories\keep-presence\src\keep-presence.py", line 121, in move_mouse
    new_x = currentPosition[0] + delta_x
TypeError: 'NoneType' object is not subscriptable

It happens only when I lock my computer with CTRL+ALT+DEL. Otherwise it switches between active and idle just fine:

image

I am experimenting with currentPosition indices at line 121, as per error, at this time, but perhaps you can offer a better insight into the problem and/or a fix.

Thanks!

Jonas

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions