title: OMDb Api doesn't show any result - Kotlin, Android Studio
body: <p>I followed everything carefully, step by step, but I can't find what the problem is.
  Whenever I fill in the name of the movie I intend to search by, the app crashes and it says this:
  java.lang.NullPointerException: response.body() must not be null</p>
  <p>Does anyone have any idea? Here is the following code.</p>
  <p>MovieList.kt</p>
  <pre><code>class MovieList {
      val imdbID: String
      val Title: String
      val Year: String
      val Plot: String
      val Poster: String
  
      constructor(imdbID: String, Title: String, Year: String, Plot: String, Poster: String) {
          this.imdbID = imdbID
          this.Title = Title
          this.Year = Year
          this.Plot = Plot
          this.Poster = Poster
      }
  }
  </code></pre>
  <p>OMDbApi.kt</p>
  <pre><code>interface OMDbApi {
      @GET(&quot;t={Title}&quot;)
      fun getMovieByTitle(@Path(&quot;Title&quot;) Title: String): Call&lt;MovieList&gt;
  }
  </code></pre>
  <p>OMDbApiClient.kt</p>
  <pre><code>class OMDbApiClient {
  
      companion object{
          private var omdbapi: OMDbApi? = null
  
          fun getOMDbApi(): OMDbApi?{
              if(omdbapi == null){
                  omdbapi = Retrofit.Builder()
                      .baseUrl(&quot;http://www.omdbapi.com/?&amp;apikey=eb73867f&quot;)
                      .addConverterFactory(GsonConverterFactory.create())
                      .build()
                      .create(OMDbApi::class.java);
  
              }
  
              return omdbapi
          }
  
      }
  
  }
  </code></pre>
  <p>FirstFragment.kt</p>
  <pre><code>class FirstFragment : Fragment() {
      private lateinit var omdbapiClient: OMDbApi
      private lateinit var tvMovieTitle: TextView
      private lateinit var ivImagePoster: ImageView
  
      override fun onCreateView(
          inflater: LayoutInflater, container: ViewGroup?,
          savedInstanceState: Bundle?
      ): View? {
          return inflater.inflate(R.layout.fragment_first, container, false)
      }
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          super.onViewCreated(view, savedInstanceState)
  
          omdbapiClient = OMDbApiClient.getOMDbApi()!!
  
          val movieId: EditText = view.findViewById&lt;EditText&gt;(R.id.TitleId)
  
          tvMovieTitle = view.findViewById(R.id.MovieTitleId)
          ivImagePoster = view.findViewById(R.id.MoviePosterId)
  
          movieId.setOnEditorActionListener { v, actionId, event -&gt;
              if(actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT){
                  val movietitle: String = movieId.text.toString()
                  searchMovieByTitle(movietitle)
                  true
              }
              else{
                  Toast.makeText(activity, &quot;Error!&quot;, Toast.LENGTH_LONG).show()
                  false
              }
          }
      }
  
      private fun searchMovieByTitle(movietitle: String) {
          omdbapiClient.getMovieByTitle(movietitle).enqueue(object : Callback&lt;MovieList&gt;{
              override fun onResponse(call: Call&lt;MovieList&gt;?, response: Response&lt;MovieList&gt;) {
                  displayData(response.body())
                  Toast.makeText(activity, &quot;Success!&quot;, Toast.LENGTH_LONG).show()
              }
  
              override fun onFailure(call: Call&lt;MovieList&gt;?, t: Throwable?) {
                  Toast.makeText(activity, &quot;Error!&quot;, Toast.LENGTH_LONG).show()
              }
  
          })
      }
  
      private fun displayData(data: MovieList) {
          tvMovieTitle.text = data.Title
          Glide.with(this).load(data.Poster).into(ivImagePoster)
      }
  
  
  }
  </code></pre>