We've got a null check on hardware above - my gut reaction was that was sufficient. But you're right. Adding a checkNotNull on hardware.getUri()