node-sword-interface 1.0.26 → 1.0.27
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/package.json
CHANGED
|
@@ -83,9 +83,12 @@ bool ModuleHelper::moduleHasBook(sword::SWModule* module, std::string bookCode)
|
|
|
83
83
|
For apocryphal books we may get "Rev 1:1" as actual module key and this will mismatch with the set key
|
|
84
84
|
and then indicate that the book is not existing. */
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
// We compare the first three letters of the two keys to see whether the key retrieved matches the key we are looking for
|
|
87
|
+
if (moduleKeyText.size() >= 3 && key.str().size() >= 3 && moduleKeyText.substr(0,3) != key.str().substr(0,3)) {
|
|
87
88
|
hasBook = false;
|
|
88
89
|
} else {
|
|
90
|
+
// The first three letters of the key seem ok.
|
|
91
|
+
// Now let's check next whether the module has the corresponding entry.
|
|
89
92
|
hasBook = module->hasEntry(module->getKey());
|
|
90
93
|
}
|
|
91
94
|
|