Resource constructor Null safety

Resource()