Fix coding standards
Better check to for a null resource