Bug 22675: Fix SCO behaviour on non-existent barcodes
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 9 Apr 2019 18:59:14 +0000 (15:59 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 10 Apr 2019 20:07:52 +0000 (20:07 +0000)
commit5b11c25fe76415078d1b48956512c29c0b2030b1
treefbac0b79778781a8ad24034f988a736731e1c07d
parent383ec1f51b4c505ac23471f8b5ee1622dc862787
Bug 22675: Fix SCO behaviour on non-existent barcodes

Bug 21206 replaced GetItem for Koha::Items->find, and introduced this
problem. This patch verifies $item is defined before attempting to use
its methods.

To test:
- Log into SCO
- Type an invalid barcode
=> FAIL: Things explode :-/
- Apply this patch, reload
- Type an invalid barcode
=> SUCCESS: A nice error message is displayed :-D
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
opac/sco/sco-main.pl