adapt-authoring-lang 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/LangModule.js CHANGED
@@ -183,7 +183,7 @@ class LangModule extends AbstractModule {
183
183
  * @returns The translated error (if passed error is not an instance of AdaptError, the original value will be returned)
184
184
  */
185
185
  translateError (lang, error) {
186
- return error.constructor.name.endsWith('Error') ? this.translate(lang, `error.${error.code}`, error.data ?? error) : error
186
+ return error?.constructor.name.endsWith('Error') ? this.translate(lang, `error.${error.code}`, error.data ?? error) : error
187
187
  }
188
188
  }
189
189
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adapt-authoring-lang",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Localisation for the Adapt authoring tool",
5
5
  "homepage": "https://github.com/taylortom/adapt-authoring-lang",
6
6
  "license": "GPL-3.0",