NathanWalker / nativescript-ngx-fonticon

Use custom font icon collections seamlessly with NativeScript + Angular.
MIT License
76 stars 39 forks source link

Livesync exception fix #10

Closed Cselt closed 7 years ago

Cselt commented 7 years ago

If you run your app with livesync then the second run will fail with an exception:

JS: Unhandled Promise rejection: Error in modules/login/login/login.html:null:null caused by: Cannot convert undefined or null to object ; Zone: angular ; Task: Promise.then ; Value: Error: Error in modules/login/login/login.html:null:null caused by: Cannot convert undefined or null to object TypeError: Cannot convert undefined or null to object
JS:     at Function.keys (native)
JS:     at TNSFontIconService.loadCss (/data/data/com.cae.lsmobile/files/app/tns_modules/nativescript-ng2-fonticon/src/app/services/fonticon.service.js:23:42)
JS:     at new TNSFontIconService (/data/data/com.cae.lsmobile/files/app/tns_modules/nativescript-ng2-fonticon/src/app/services/fonticon.service.js:18:14)
JS:     at NgModuleInjector.Object.defineProperty.get (AppModule.ngfactory.js:255:81)
JS:     at NgModuleInjector.AppModuleInjector.getInternal (AppModule.ngfactory.js:387:58)
JS:     at NgModuleInjector.get (/data/data/com.cae.lsmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:7221:31)
JS:     at ElementInjector.get (/data/data/com.cae.lsmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:9303:52)
JS:     at ReflectiveInjector_._getByKeyDefault (/data/data/com.cae.lsmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:3391:28)
JS:     at ReflectiveInjector_._getByKey (/data/data/com.cae.lsmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:3357:29)
JS:     at ReflectiveInjector_.get (/data/data/com.cae.lsmobile/files/app/tns_modules/@angular/core/bundles/core.umd.js:3166:25)
JS: Error: Uncaught (in promise): Error: Error in modules/login/login/login.html:null:null caused by: Cannot convert undefined or null to object

This can be fixed by deleting line 40 in fonticon.service.ts.

NathanWalker commented 7 years ago

Thank you!

NathanWalker commented 7 years ago

Published now with 1.3.3. 👍