How can I compare object types in an "if" statement

I'm writing a script that will duplicate objects along a path. I need some way to make sure the path was selected first.

Basically what I want to do is

if (selected object is not a curve)
error message

but I can't figure out how write the code to return a boolean value if it is or isn't a curve. The Command objectType only returns a string "transform".

// you need to find the "shape" node of what you have selected:
string $sel[] = ls -sl;
string $shapes[] = listRelatives -s $sel[0];
if (objectType($shapes[0]) != "nurbsCurve")
error "Not a curve";

thanks, that worked perfectly.