can this be `else if (res == null) {...`