Fix null check for function wrapper