Can't multiply sequence by non-int of type 'Conditional'

I noticed that the non-smooth variational term seems to return an error, and I wonder if there is a problem with my finite element setup, and I hope you can help me.

g = (0.0, 9.80665)
...
P1 = FiniteElement("Lagrange", mesh.ufl_cell(), 1)
P2 = VectorElement("Lagrange", mesh.ufl_cell(), 2)
element = MixedElement([P1, P1, P2, P1])
ME = FunctionSpace(mesh, element)
d_c_mu_u_p = TrialFunction(ME)
fai, pot, v, q = TestFunctions(ME)
...
c_mu_u_p = Function(ME)
c, mu, u, p = split(c_mu_u_p)
...
L2 = ...+\
inner(rho(c) * g, v) * dx #There are problems in this line

rho( c ) is a Conditional expression that is nonsmooth

Traceback (most recent call last):
  File "/home/wangyao/download/hello_word/main.py", line 139, in <module>
    dt / rho_int_ox * inner(rho(c) * g, v) * dx
TypeError: can't multiply sequence by non-int of type 'Conditional'

In order to simplify my question, I only gave part of the code, and If anyone later needs the full code I’ll provide

This should be written as either:

g=Constant((0,9.80665))

or

g=as_vector((0,9.80665))

Thank you and I think it’s right.