Hotfix: do not expect BuildContext to be available

Outside of Eclipse, the BuildContext is not necessarily available. So
let's be prepared for the case that the buildContext variable is
actually null.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>