Getting an unspecified error when submitting Isogram in C

I am getting this error when submitting Isogram in C:
"An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that’s causing our systems to break.

Please check your code, and if nothing seems to be wrong, try running the tests again."

This is my code:

#include "isogram.h"
#include <string.h>
#include <ctype.h>
#include <stdio.h>

bool is_isogram(const char phrase[])
{
    int length = strlen(phrase);
    for (int i = 0; i < length; i++)
    {
        for (int j = i + 1; j < length; j++)
        {
           if (tolower(phrase[i]) != tolower(phrase[j]) && phrase[i] != '-' && phrase[j] != '-')
           {
               printf("Not an isogram!");
               return false;
           }       
        }
    }
    printf("An isogram!");
    return true;
}

I’ve narrowed down the issue to the comparison if statement, as the test runs without it, but as this is the key function of the code (and community code I’ve looked at), I’m not sure if this is bug with the platform.

You may want to take a look at the test file and see if you’re missing any edge cases that the tests might throw at the code.

Following Isaac’s comment, specifically what happens if phrase is NULL?

Consider the logic there: if the characters are different, then you conclude it is not an isogram.

Thanks both. I needed to check for NULL and call strlen() after NULL. And thanks Glenn for noting the equality error. I wasn’t sure if it was my issue or something else because of the error message I had, but now I know to look harder at my code!

Here is my updated code that passed all the tests (also broke out the space and hyphen check):

bool is_isogram(const char phrase[])
{
    if (phrase == NULL)
    {
        return false;
    }
    int length = strlen(phrase);
    for (int i = 0; i < length; i++)
    {
        for (int j = i + 1; j < length; j++)
        {
            if (phrase[i] == ' ' || phrase[i] == '-')
            {
                break;
            }
            else
            {
                if (tolower(phrase[i]) == tolower(phrase[j]))
                {
                    return false;
                }
            }
        }
    }
    return true;
}