Bug 36868: (QA follow-up) Fix deletion off by one error
When the biblionumber is not in the array -1 is returned. Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
9b5f75a79e
commit
ae903a008d
|
|
@ -270,8 +270,8 @@ function delSingleRecord(biblionumber) {
|
|||
var arrayRecords = valCookie.split("/");
|
||||
var pos = jQuery.inArray(biblionumber, arrayRecords);
|
||||
|
||||
// the cart is empty, bail
|
||||
if (pos <= 0) {
|
||||
// if pos is -1, the cart is empty, bail
|
||||
if (pos === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -236,8 +236,8 @@ function delSingleRecord(biblionumber) {
|
|||
var pos = jQuery.inArray(biblionumber, arrayRecords);
|
||||
arrayRecords.splice(pos, 1);
|
||||
|
||||
//if cart is empty, bail
|
||||
if (pos <= -1) {
|
||||
// if pos is -1, the cart is empty, bail
|
||||
if (pos === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue