I am checking if a struct exists in vehicleList and returning true if it exists and false if it does not.
However, the function produces an error and I can't understand why it does not work.
TypeError: Type uint256 is not implicitly convertible to expected type bool. if (bytes(vehicleList[_registrationNo].vehicleRegistrationNo).length =! 0) {
function checkVehicleExists (string memory _registrationNo) public view returns (bool) {
bool vehicleExists = false;
if (bytes(vehicleList[_registrationNo].vehicleRegistrationNo).length =! 0) {
vehicleExists = true;
}
return (vehicleExists);
}