Turned "assert" in ResourceUtils into "if"