Swiping right till text matches string

I’m trying to automate swiping right on iOS hardware device. The swiping action should continue until two strings match.

do {
AppActions.swipeRight(mobileDriver);
}
while(GuidePage.strNextDay.equals(GuidePage.strDay));

when I try the above, i get a null pointer exception. Help pls!

try to debug, logic looks fine

if ( GuidePage.strNextDay != null && GuidePage.strDay) != null) {
do {
AppActions.swipeRight(mobileDriver);
}
while(GuidePage.strNextDay.equals(GuidePage.strDay))
}