Fixed segfault for unsupported encodings

After failing a null check filter is being used anyway causing a segmentation fault. This seems to fix the issue.