Show where you register your capability.
And this "Oh, it's null... guess I'll do nothing then and not report this error" behavior is terrible. This is not PHP. If something so fundamental is wrong, throw an exception! Crashing the game is OK if your code has bugs. Don't try to sweep the errors under the rug. It makes things way more hard to debug.