package jp.toastkid.search_widget.favorite;

import android.app.SearchManager;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;

/**
 *
 * @author toastkidjp
 */
public class AddingFavoriteSearchService extends Service {

    public static final String EXTRA_KEY_CATEGORY = "Category";

    public static final String EXTRA_KEY_QUERY    = SearchManager.QUERY;

    @Override
    public int onStartCommand(final Intent intent, final int flags, final int startId) {
        new Insertion(
                getApplicationContext(),
                intent.getStringExtra(EXTRA_KEY_CATEGORY),
                intent.getStringExtra(EXTRA_KEY_QUERY)
        ).insert();
        return super.onStartCommand(intent, flags, startId);
    }

    @Nullable
    @Override
    public IBinder onBind(final Intent intent) {
        return null;
    }

}

@@ -534,24 +534,111 @@
  startId) %7B%0A
+        if (intent == null) %7B%0A            return START_STICKY_COMPATIBILITY;%0A        %7D%0A
         new 
@@ -842,52 +842,34 @@
 urn 
-super.onStartCommand(intent, flags, startId)
+START_STICKY_COMPATIBILITY
 ;%0A  

Add null check.