yanus171/Handy-News-Reader

App crashes everytime after failing to import an autobackup. "Parameter specified as non-null is null" and "cursor.getString(1) must not be null"

ItsIgnacioPortal opened this issue · 4 comments

Describe the bug
The app crashes after trying to restore a backup. After the initial crash, the app will crash everytime you try to open it. This issue exists both in stable and beta versions. I believe this is the same issue from #854, which was left unresolved because the original reporter bailed.

To Reproduce
Steps to reproduce the behavior:

  1. Install the latest beta
  2. Open the Handy Reading app
  3. Allow access to file and media
  4. On the "Do you want to import feeds and app settings from autobackup file" dialog, tap "Ok"
  5. Select the backup file
  6. Wait
  7. The crash happens

Expected behavior
I expected to be able to import an existing backup without the app crashing.

Screenshots
I've recorded a video of this issue: https://www.youtube.com/watch?v=9nF0x_5LimQ
Here is the backup file I tried to import: https://mega.nz/file/EpgGBSJS#vBSh8vmWVnHWoh22UXPazNMaX39y7XW6lScAPGojN0s

Smartphone (please complete the following information):

  • Device: Moto e6 plus
  • OS: Android 12
  • Browser: Firefox
  • Version: Handy Reading v0.19.10

Additional context

When the app first crashes, this is the error it throws:

UNCAUGHT EXCEPTION
-------------------
Stacktrace:
java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter name
	at ru.yanus171.feedexfork.utils.LabelVoc.addLabel(Unknown Source:2)
	at ru.yanus171.feedexfork.parser.OPML$OPMLParser.startElement(OPML.java:682)
	at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:154)
	at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
	at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:526)
	at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:487)
	at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:324)
	at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:287)
	at android.util.Xml.parse(Xml.java:109)
	at ru.yanus171.feedexfork.parser.OPML.importFromFile(OPML.java:224)
	at ru.yanus171.feedexfork.parser.OPML.importFromFile(OPML.java:207)
	at ru.yanus171.feedexfork.service.FetcherService.lambda$Process$1(FetcherService.java:363)
	at ru.yanus171.feedexfork.service.FetcherService$$ExternalSyntheticLambda1.run(Unknown Source:2)
	at ru.yanus171.feedexfork.service.FetcherService.LongOper(FetcherService.java:622)
	at ru.yanus171.feedexfork.service.FetcherService.LongOper(FetcherService.java:610)
	at ru.yanus171.feedexfork.service.FetcherService.Process(FetcherService.java:357)
	at ru.yanus171.feedexfork.service.FetcherService.onHandleIntent(FetcherService.java:328)
	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.os.HandlerThread.run(HandlerThread.java:67)

-------------------
Version : 0.19.10
Version Code: 320
Package : ru.yanus171.feedexfork
FilePath : /data/user/0/ru.yanus171.feedexfork/files
Phone Model: moto e(6) plus
Android Version : 12
Board : p161bn
Brand : google
Device : pokerp
Model : moto e(6) plus
Product : pokerp
User : crossgate
Total Internal memory : 56337235968
Available Internal memory : 22816837632
-------------------

If I then try to open the app, after that crash, I always get this error:

UNCAUGHT EXCEPTION
-------------------
Stacktrace:
java.lang.NullPointerException: cursor.getString(1) must not be null
	at ru.yanus171.feedexfork.utils.Label.<init>(LabelVoc.kt:46)
	at ru.yanus171.feedexfork.utils.LabelVoc.init_(LabelVoc.kt:75)
	at ru.yanus171.feedexfork.utils.LabelVoc.initInThread$lambda$16(LabelVoc.kt:262)
	at ru.yanus171.feedexfork.utils.LabelVoc.$r8$lambda$ya7V_aAmMtg742-4CnwALplM0tk(Unknown Source:0)
	at ru.yanus171.feedexfork.utils.LabelVoc$$ExternalSyntheticLambda0.run(Unknown Source:0)
	at java.lang.Thread.run(Thread.java:920)

-------------------
Version : 0.19.10
Version Code: 320
Package : ru.yanus171.feedexfork
FilePath : /data/user/0/ru.yanus171.feedexfork/files
Phone Model: moto e(6) plus
Android Version : 12
Board : p161bn
Brand : google
Device : pokerp
Model : moto e(6) plus
Product : pokerp
User : crossgate
Total Internal memory : 56337235968
Available Internal memory : 22824292352
-------------------

On v0.19.11, I get this error when it's almost done importing the backup:

UNCAUGHT EXCEPTION
-------------------
Stacktrace:
java.lang.NullPointerException: cursor.getString(1) must not be null
	at ru.yanus171.feedexfork.utils.Label.<init>(LabelVoc.kt:46)
	at ru.yanus171.feedexfork.utils.LabelVoc.init_(LabelVoc.kt:75)
	at ru.yanus171.feedexfork.utils.LabelVoc.reinit(LabelVoc.kt:273)
	at ru.yanus171.feedexfork.parser.OPML.importFromFile(OPML.java:227)
	at ru.yanus171.feedexfork.parser.OPML.importFromFile(OPML.java:207)
	at ru.yanus171.feedexfork.service.FetcherService.lambda$Process$1(FetcherService.java:363)
	at ru.yanus171.feedexfork.service.FetcherService$$ExternalSyntheticLambda1.run(Unknown Source:2)
	at ru.yanus171.feedexfork.service.FetcherService.LongOper(FetcherService.java:622)
	at ru.yanus171.feedexfork.service.FetcherService.LongOper(FetcherService.java:610)
	at ru.yanus171.feedexfork.service.FetcherService.Process(FetcherService.java:357)
	at ru.yanus171.feedexfork.service.FetcherService.onHandleIntent(FetcherService.java:328)
	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.os.HandlerThread.run(HandlerThread.java:67)

-------------------
Version : 0.19.11
Version Code: 321
Package : ru.yanus171.feedexfork
FilePath : /data/user/0/ru.yanus171.feedexfork/files
Phone Model: moto e(6) plus
Android Version : 12
Board : p161bn
Brand : google
Device : pokerp
Model : moto e(6) plus
Product : pokerp
User : crossgate
Total Internal memory : 56337235968
Available Internal memory : 21925011456
-------------------

And when I try to open the app again after that, I always get this error:

UNCAUGHT EXCEPTION
-------------------
Stacktrace:
java.lang.NullPointerException: cursor.getString(1) must not be null
	at ru.yanus171.feedexfork.utils.Label.<init>(LabelVoc.kt:46)
	at ru.yanus171.feedexfork.utils.LabelVoc.init_(LabelVoc.kt:75)
	at ru.yanus171.feedexfork.utils.LabelVoc.initInThread$lambda$16(LabelVoc.kt:262)
	at ru.yanus171.feedexfork.utils.LabelVoc.$r8$lambda$ya7V_aAmMtg742-4CnwALplM0tk(Unknown Source:0)
	at ru.yanus171.feedexfork.utils.LabelVoc$$ExternalSyntheticLambda0.run(Unknown Source:0)
	at java.lang.Thread.run(Thread.java:920)

-------------------
Version : 0.19.11
Version Code: 321
Package : ru.yanus171.feedexfork
FilePath : /data/user/0/ru.yanus171.feedexfork/files
Phone Model: moto e(6) plus
Android Version : 12
Board : p161bn
Brand : google
Device : pokerp
Model : moto e(6) plus
Product : pokerp
User : crossgate
Total Internal memory : 56337235968
Available Internal memory : 21932908544
-------------------

Try #683 (comment)

v0.19.12 imports the backup successfully. Tysm for fixing this! 🎉