Saw this triggered by a situation where a branch had been removed but some rules remained. However when doing a lookup the return should always be tested for validity. Because it wasnt when methods were called on null the overdues_notices process aborts with a runtime error and subsequent branches overdues are not processed. Untested returns are one of the biggest causes of errors and often hard to track down errors in the system .
Created attachment 80326 [details] [review] Patch to test a valid object returned Adds a run-time test to ensure the assumption of the following code is true. Without the patch process aborts on call to branchemail method. With patch applied if find fails to return a valid library we skip to the next and issue an error listing the problematic branchcode As we dont live in the "best of all possible worlds" code should be more pessimistic and test for unexpected results
(In reply to Colin Campbell from comment #1) > Created attachment 80326 [details] [review] [review] > Patch to test a valid object returned > > Adds a run-time test to ensure the assumption of the following code is true. > Without the patch process aborts on call to branchemail method. > > With patch applied if find fails to return a valid library we skip to the > next and issue an error listing the problematic branchcode > > As we dont live in the "best of all possible worlds" code should be more > pessimistic and test for unexpected results Hi, is there some test plan for this patch?
Hi Colin, I'm wondering if this situation will have been helped by the fix for bug 22679 - thoughts?
I'm marking this Failed QA because comment 2 and comment 3 need to be addressed before this can be signed off.
Pretty sure this is caught at this point.. either way I'm closing and we can open a fresh bug when we spot it in the wild.