betweenGo

Archive for December, 2009

Twitter Weekly Updates for 2009-12-20

by Frank Kim on Dec.20, 2009, under Miscellaneous

  • Undefined – betweenGo. Turns out there are at least two ways to determine if something is undefined in JavaScript. http://bit.ly/4Q98X5 #
  • NullPointerException in ATG OrderDiscountCalculator – betweenGo. Fortunately fix was simple. Notifying @atg_support. http://bit.ly/84iTKB #
  • Share/Bookmark
Leave a Comment more...

NullPointerException in ATG OrderDiscountCalculator

by Frank Kim on Dec.15, 2009, under Commerce

calculator on Flickr

(Photo: calculator by ansik)

There is a bug in the ATG OrderDiscountCalculator which causes a NullPointerException (NPE) under certain conditions.  Fortunately ATG provides the source for this class (I wish they did for all their classes or at least a larger subset of them) so it was pretty simple to figure out why this was happening.

The OrderDiscountCalculator assumes that the taxableShippingGroupSubtotalInfo local will not be null.  If it is an NPE will result when this local is referenced and the page that called this calculator will crash.

The simple fix is to check if it is null and if it is to continue to the next shipping group.

if (taxableShippingGroupSubtotalInfo == null) {
  continue;
}

At my request ATG Support has filed a problem report, NullPointerException in OrderDiscountCalculator.

Update 12-17-2009: ATG may have fixed this issue for ATG 9.1 p1, NPE in OrderDiscountCalculator w/empty shipping groups in Order.

  • Share/Bookmark
Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!