Vendor.js load app Uncaught (in promise): TypeError: Cannot read properties of null (reading '0')

Hello everyone !

I have just requested your help concerning an error that I encounter when loading my application.
I use firebase notification, I store my notifications as JSON with writeFile() in a folder “externalDataDirectory”.

this.file.writeFile(this.file.externalDataDirectory, this.fileName + ‘.json’, JSON.stringify(data), { replace: true })

Everything works fine, however when I restart my application I have this error :

vendor.js:48230 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of null (reading ‘0’)
TypeError: Cannot read properties of null (reading ‘0’)
at main.js:235:31
at ZoneDelegate.invoke (polyfills.js:436:30)
at Object.onInvoke (vendor.js:70424:33)
at ZoneDelegate.invoke (polyfills.js:435:56)
at Zone.run (polyfills.js:196:47)
at polyfills.js:1354:38
at ZoneDelegate.invokeTask (polyfills.js:470:35)
at Object.onInvokeTask (vendor.js:70411:33)
at ZoneDelegate.invokeTask (polyfills.js:469:64)
at Zone.runTask (polyfills.js:241:51)
at resolvePromise (polyfills.js:1291:35)
at polyfills.js:1361:21
at ZoneDelegate.invokeTask (polyfills.js:470:35)
at Object.onInvokeTask (vendor.js:70411:33)
at ZoneDelegate.invokeTask (polyfills.js:469:64)
at Zone.runTask (polyfills.js:241:51)
at drainMicroTaskQueue (polyfills.js:656:39)

Thanks in advance for your help