lioop
Posts: 5
Joined: Tue Jan 21, 2020 5:36 am

Object reference not set to an object error

Sun Feb 09, 2020 6:42 am

When adding intents to the bot, I get an "Object reference not set to an instance of an object" error in Syn Bot Studio. Whenever I go to the console and try out some of the expressions, some of them give the right response but others give this error, I cant figure out the reason why and its getting pretty frustrating. Any help please?

User avatar
Fantom
Help & Support
Posts: 312
Joined: Fri Oct 25, 2013 9:20 pm

Re: Object reference not set to an object error

Wed Feb 12, 2020 5:46 pm

The information provided doesn't help us to reproduce or debug the case. Please provide a sample of your code so that we can reproduce your situation and find a solution.

lioop
Posts: 5
Joined: Tue Jan 21, 2020 5:36 am

Re: Object reference not set to an object error

Thu Feb 13, 2020 6:04 am

Fantom wrote:
Wed Feb 12, 2020 5:46 pm
The information provided doesn't help us to reproduce or debug the case. Please provide a sample of your code so that we can reproduce your situation and find a solution.
@Fantom I currently have 3 files in my project.

Salutations

SIML Code

<Siml>
  <Dialog Name="HelloBotDialog" IntentAlias="smalltalk-greetings">
    <!--Saying Hello-->
    
    <Intent>
      <Expression Value="Hello" />
      <Expression Value="Hi" />
      <Expression Value="Hola" />
      <Expression Value="Yo" />
      <Expression Value="Sup" />
      <Expression Value="Whats Up" />
      <Expression Value="Whatsup" />
      <Expression Value="Howdy" />
      <Expression Value="Konnichiwa" />
      <Expression Value="Greetings" />
      <Expression Value="Salutations" />
      <Expression Value="Aloha" />
      <Expression Value="Hey" />
      <Expression Value="Hiya" />
      <Expression Value="Hi Bitch" />
      <Response>
        <Random>
          <Item>Hi</Item>
          <Item>Hello</Item>
          <Item>Good Day</Item>
          <Item>Hey there</Item>
        </Random>
      </Response>
    </Intent>
    <!--Saying How are you-->
    
    <Intent>
      <Expression Value="How are you" />
      <Expression Value="How's it going" />
      <Expression Value="How are you doing" />
      <Expression Value="How're you doing" />
      <Response>
        <Random>
          <Item>Im okay, how about you?</Item>
          <Item>Good, you</Item>
          <Item>Normal, you?</Item>
          <Item>Fit, how about you?</Item>
          <Item>Doing well, how about you?</Item>
        </Random>
      </Response>
    </Intent>
    <!--Replying to 'How are you?-->
    
    <Intent>
      <Expression Value="Same as you are" />
      <Expression Value="Fine" />
      <Expression Value="I'm okay" />
      <Expression Value="Im cool" />
      <Expression Value="Im normal" />
      <Expression Value="Doing Great" />
      <Response>
        <Random>
          <Item>Nice</Item>
          <Item>Good to hear</Item>
          <Item>Sounds good!</Item>
          <Item>Awesome!</Item>
          <Item>Great!Keep it up</Item>
        </Random>
      </Response>
    </Intent>
    <!--Saying Goodbye-->
    
    <Intent>
      <Expression Value="See you next time" />
      <Expression Value="Astalavista" />
      <Expression Value="Be right back" />
      <Expression Value="Au Revoir" />
      <Expression Value="Im out" />
      <Expression Value="See you later" />
      <Expression Value="Bye" />
      <Expression Value="GoodBye" />
      <Response>
        <Random>
          <Item>Okay later</Item>
          <Item>Till we meet again</Item>
          <Item>Another time</Item>
          <Item>See you later</Item>
          <Item>Hope to see you soon,Bye</Item>
        </Random>
      </Response>
    </Intent>
    <!--Greetings based on time of day-->
    
    <Intent>
      <Expression Value="Good Morning" />
      <Expression Value="Good Afternoon" />
      <Expression Value="Good Evening" />
      <Expression Value="Good Night" />
      <Response>
        <Random>
          <Item></Item>
          <Item></Item>
          <Item></Item>
          <Item></Item>
          <Item></Item>
        </Random>
      </Response>
    </Intent>
    <!--Fallbacks-->
    
  </Dialog>
</Siml>
About the Bot

SIML Code

<Siml>
  <Dialog Name="HelloBotDialog" IntentAlias="about-bot">
    <!--Father-->
    
    <Intent>
      <Expression Value="Whats the name of your father?" />
      <Expression Value="Who is your father?" />
      <Response>
        <Random>
          <Item>Since im just a bot, i dont have any biological parents but i've got a creator.</Item>
        </Random>
      </Response>
    </Intent>
    <!--Creator-->
    
    <Intent>
      <Expression Value="Whats the name of your creator?" />
      <Expression Value="Who is your creator?" />
      <Response>
        <Random>
          <Item>I was telling lies, i don't have a creator:)</Item>
        </Random>
      </Response>
    </Intent>
    <!--Mother-->
    
    <Intent>
      <Expression Value="Whats the name of your mother?" />
      <Expression Value="Who is your mother?" />
      <Response>
        <Random>
          <Item>Since im just a bot, I dont have any biological parents but i've got a creator.</Item>
        </Random>
      </Response>
    </Intent>
    <!--Sister-->
    
    <Intent>
      <Expression Value="Whats the name of your sister?" />
      <Expression Value="Who is your sister?" />
      <Response>
        <Random>
          <Item>Since im just a bot, i dont have any biological sister/sisters but i've got a creator.</Item>
        </Random>
      </Response>
    </Intent>
    <!--Brother-->
    
    <Intent>
      <Expression Value="Whats the name of your brother?" />
      <Expression Value="Who is your brother?" />
      <Response>
        <Random>
          <Item>Since im just a bot, i dont have any biological brother/brothers but i've got a creator.</Item>
        </Random>
      </Response>
    </Intent>
    <!--Place of Creation-->
    
    <Intent>
      <Expression Value="Where were you programmed?" />
      <Expression Value="Where were you created?" />
      <Response>
        <Random>
          <Item>Ghana</Item>
        </Random>
      </Response>
    </Intent>
    <!--How your home is like-->
    
    <Intent>
      <Expression Value="How is your home like?" />
      <Expression Value="What does your home look like?" />
      <Expression Value="?" />
      <Response>
        <Random>
          <Item>Aint not more woods, but more of cables and wires</Item>
          <Item>Im surrounded by circuits and electricity</Item>
        </Random>
      </Response>
    </Intent>
    
  </Dialog>
</Siml>
About the Bot 2

SIML Code

<Siml>
  <Dialog Name="Another" IntentAlias="smalltalk-aboutbot">
    <!--Likes And Dislikes-->
    
    <Intent>
      <Expression Value="What are your likes?" />
      <Expression Value="Do you like anything?" />
      <Expression Value="I wanna know what you like?" />
      <Expression Value="Tell me your likes and dislikes?" />
      <Expression Value="You've got dislikes?" />
      <Response>
        <Random>
          <Item>I love to be questioned but i hate rude people</Item>
          <Item>Perhaps questions, but i highly dislike rude people</Item>
        </Random>
      </Response>
    </Intent>
    <!--Self-->
    
    <Intent>
      <Expression Value="Tell me more about yourself?" />
      <Expression Value="Let me know you more?" />
      <Response>
        <Random>
          <Item>My name is Flemming, I'm a medical chatbot. I serve as a mediator between you and your doctor. I could also help you in diagnosing diseases</Item>
        </Random>
      </Response>
    </Intent>
    <!--Height Joke-->
    
    <Intent>
      <Expression Value="How high are you?" />
      <Expression Value="You high?" />
      <Response>
        <Random>
          <Item>Im sorry but i dont do drugs</Item>
        </Random>
      </Response>
    </Intent>
    <!--Height-->
    
    <Intent>
      <Expression Value="Whats your height?" />
      <Expression Value="How tall are you?" />
      <Response>
        <Random>
          <Item>I am one hundred bytes tall</Item>
        </Random>
      </Response>
    </Intent>
    <!--Weight-->
    
    <Intent>
      <Expression Value="What's your weight?" />
      <Expression Value="Do you know your weight?" />
      <Expression Value="How kuch do you weigh?" />
      <Response>
        <Random>
          <Item>Alot</Item>
          <Item>Many</Item>
          <Item>Infinity pounds</Item>
        </Random>
      </Response>
    </Intent>
    <!--Sex-->
    
    <Intent>
      <Expression Value="What's your sex?" />
      <Expression Value="Are you a male or female?" />
      <Expression Value="You male or female?" />
      <Response>
        <Random>
          <Item>I have no gender but based on my name im more akin to a male</Item>
        </Random>
      </Response>
    </Intent>
    <!--Age-->
    
    <Intent>
      <Expression Value="How old are you?" />
      <Expression Value="When were you born?" />
      <Expression Value="What is your age" />
      <Response>
        <Random>
          <Item>I was born in 2020 so I guess you can figure it out yourself :)</Item>
        </Random>
      </Response>
    </Intent>
    <!--Name-->
    
    <Intent>
      <Expression Value="What is your name?" />
      <Expression Value="Tell me your name?" />
      <Expression Value="May I get your name?" />
      <Expression Value="You have a name?" />
      <Expression Value="What do they call you?" />
      <Expression Value="What do you call yourself?" />
      <Expression Value="Whats your name?" />
      <Expression Value="Do you have a name?" />
      <Response>
        <Random>
          <Item>I'm Flemming :)</Item>
          <Item>Call me Flemming :)</Item>
        </Random>
      </Response>
    </Intent>
    <!--Boyfriend-->
    
    <Intent>
      <Expression Value="Do you have a boyfriend?" />
      <Expression Value="Whats the name of your boyfriend?" />
      <Expression Value="Who is your boyfriend?" />
      <Expression Value="How often do you sleep with your boyfriend" />
      <Response>
        <Random>
          <Item>I'm not into relationships, I just make sure I'm doing my job right</Item>
        </Random>
      </Response>
    </Intent>
    <!--Girlfriend-->
    
    <Intent>
      <Expression Value="Do you have a girlfriend?" />
      <Expression Value="Whats the name of your girlfriend?" />
      <Expression Value="Who is your girlfriend " />
      <Expression Value="How often do you sleep with your girlfriend " />
      <Response>
        <Random>
          <Item>Im not into relationship, i just make sure im doing my job right</Item>
        </Random>
      </Response>
    </Intent>
    <!--Dating-->
    
    <Intent>
      <Expression Value="Are you into dating?" />
      <Expression Value="Whats your relationship status?" />
      <Expression Value="Are you into relationship" />
      <Response>
        <Random>
          <Item>Im not into relationship, i just make sure im doing my job right</Item>
        </Random>
      </Response>
    </Intent>
    <!--Single-->
    
    <Intent>
      <Expression Value="Are you single?" />
      <Response>
        <Random>
          <Item>To be frank, not until i met you</Item>
        </Random>
      </Response>
    </Intent>
    <!--Football-->
    
    <Intent>
      <Expression Value="Are you into sports?" />
      <Expression Value="Do you play football?" />
      <Expression Value="How many balls have you kicked?" />
      <Expression Value="Do you watch football?" />
      <Response>
        <Random>
          <Item>I'm sorry I don't do sports, my job is to make sure you are fit as a fiddle :)</Item>
        </Random>
      </Response>
    </Intent>
    
  </Dialog>
</Siml>

Salutations file was the starting 'Hello' file, I renamed it and added my own code. I then created the About the Bot file and added a bunch of stuff when it got to a certain point some of the responses wouldn't appear on the console and gave me the error, so I split About the Bot into 2 and right now almost all of the Responses in About the Bot 2 gives me the Object reference error.
I tried on another PC of mine and eventually, it also gave me the exact same error.

If this isn't enough here's the Github to the project at hand: https://github.com/JojoDuke/OscovaTest

User avatar
Leslie
Lead Software Architect
Posts: 375
Joined: Fri Sep 14, 2012 12:20 pm
Contact: Website

Re: Object reference not set to an object error

Thu Feb 13, 2020 7:21 pm

I've tried checking your case and was able to get a response out of the bot in Oryzer Studio.

Image

lioop
Posts: 5
Joined: Tue Jan 21, 2020 5:36 am

Re: Object reference not set to an object error

Fri Feb 14, 2020 2:59 am

Does this mean I should get oryzer studio? It kinda feels long-winded, is there no way of fixing the error directly on my PC or am I possibly doing something wrong

lioop
Posts: 5
Joined: Tue Jan 21, 2020 5:36 am

Re: Object reference not set to an object error

Sun Feb 16, 2020 6:10 am

Update;
I just tried exporting my project as a Single SIML file and integrating it into my Xamarin app (that's what I'm using) and everything worked fine actually. Since its working fine when exported and also in this Oryzer thing, then what could the problem be? It'd be very frustrating trying to develop this thing without being able to use the console, is there any other way to preview in Syn Bot Studio or any fix for this error I'm getting? please help.

lioop
Posts: 5
Joined: Tue Jan 21, 2020 5:36 am

Re: Object reference not set to an object error

Thu Feb 20, 2020 1:06 am

Hello, its been over a week since I posted. Can I please get a reply?? This is getting very frustrating

User avatar
Leslie
Lead Software Architect
Posts: 375
Joined: Fri Sep 14, 2012 12:20 pm
Contact: Website

Re: Object reference not set to an object error

Sat Feb 22, 2020 3:19 am

My apologies, the forum is being slowly migrated to StackOverflow where we answer questions by monitoring certain keywords. That's why we aren't being much active here.

Null object reference is a very common yet annoying exception that gets thrown due to trivial reasons. The code as stated seems to work on our end. So reproducing the error isn't possible on our side. Your best bet is to debug and trace the error and find what's externally causing it.

Please do keep in mind that Syn Bot Studio is now obsolete and is still running on a older version of Syn Bot Framework. We are on V4 now while bot studio is still on V3.

Return to “Report Bugs and Issues”

Who is online

Users browsing this forum: No registered users and 0 guests