Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot read properties of undefined (reading 'scrollTop') & etc. when connected with a game controller #253

Closed
1 task done
pein0saga opened this issue Jul 30, 2024 · 5 comments
Assignees
Labels

Comments

@pein0saga
Copy link

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

OpenComic Version

1.2.0master.cc1ebbc & below

Operating System

WIN 10 22H2 19045.3324

Steps to reproduce

Open the cbz file

Expected Behavior

Open it normally without error message.

Actual Behavior

Open it normally with an error message.

Error message


C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4725 Uncaught TypeError: Cannot read properties of undefined (reading 'scrollTop')
    at Object.reading (C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4725:28)
    at gamepadLoop (C:\Program Files\OpenComic\resources\app.asar\scripts\gamepad.js:150:19)
C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:304 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
    at disposeImages (C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:304:61)
    at resized (C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:2678:4)
C:\Program Files\OpenComic\resources\app.asar\scripts\file-manager.js:2008 extract7z: D:\_CBZ\[單行本/XXX]XXXX.cbz: 3501.384033203125 ms

Additional Information

I have a game controller connected on PC.

Gamepad.connected Read only
A boolean indicating whether the gamepad is still connected to the system.

Sample file

No response

@ollm
Copy link
Owner

ollm commented Aug 4, 2024

I'm not entirely sure, but it seems that both errors are caused by triggering a scroll event while the file is still loading, possibly by the gamepad.

I've made the following change that should ignore these events while the file is still loading 4c93a72

Build: https://mega.nz/file/DDh2wJaR#pUhJMXeSUjJd99uTz6IDXI_fV5dhfl-0TKoela5IzoQ

@pein0saga
Copy link
Author

I'm not entirely sure, but it seems that both errors are caused by triggering a scroll event while the file is still loading, possibly by the gamepad.

I've made the following change that should ignore these events while the file is still loading 4c93a72

Build: https://mega.nz/file/DDh2wJaR#pUhJMXeSUjJd99uTz6IDXI_fV5dhfl-0TKoela5IzoQ

Seems fine now

@pein0saga
Copy link
Author

pein0saga commented Aug 9, 2024

After I use below new version, similar error will still occurs.

#259 (comment)

C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4801 Uncaught TypeError: Cannot read properties of undefined (reading 'scrollTop')
    at Object.reading (C:\Program Files\OpenComic\resources\app.asar\scripts\reading.js:4801:28)
    at gamepadLoop (C:\Program Files\OpenComic\resources\app.asar\scripts\gamepad.js:150:19)

@pein0saga pein0saga reopened this Aug 9, 2024
@ollm
Copy link
Owner

ollm commented Aug 10, 2024

Try this fix 078ec8d

Build: https://mega.nz/file/bXIVDIoA#CD5cbSrvd_3cON-oq0vhWSxJ3KVqkxfRtZaUl76KeJY

@pein0saga
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants