[BUGFIX] Do not hand invalid input to ResourceFactory