This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
With the given code- really difficult to tell the reason for the Nullpointer Exception. But either board is NULL or board.getPocketArray(0, 0) is null. You would have to check that. Also check if the instances being referred in the if condition of the legalMove method are not null.