Write a function `count_vowels` to count the number of vowels in a given string.
### Notes:
- Return `nil` or `None` for non-string inputs.
- Return `0` if the parameter is omitted.
### Examples:
```python
count_vowels("abcdefg") => 2
count_vowels("aAbcdeEfg") => 4
count_vowels(12) => None
```
def count_vowels(s = ''):
    vowels = ["a","e","o","u","i"]
    counter = 0
    try:
        s = s.lower() 
        for char in s:
            if char in vowels:
                counter +=1
        return counter
    except AttributeError:
        return None
def count_vowels(s = ''):
    vowels = ["a","e","o","u","i"]
    counter = 0
    try:
        s = s.lower() 
        for char in s:
            if char in vowels:
                counter +=1
        return counter
    except AttributeError:
        return None