Skip to content

Commit 121bce7

Browse files
committed
Guard against missing activity
1 parent 4c6f9c3 commit 121bce7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/com/github/mobile/ui/comment/RawCommentFragment.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.github.mobile.ui.comment;
1717

18+
import android.app.Activity;
1819
import android.os.Bundle;
1920
import android.text.Editable;
2021
import android.view.LayoutInflater;
@@ -45,7 +46,9 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
4546

4647
@Override
4748
public void afterTextChanged(Editable s) {
48-
getActivity().invalidateOptionsMenu();
49+
Activity activity = getActivity();
50+
if (activity != null)
51+
activity.invalidateOptionsMenu();
4952
}
5053
});
5154
}

0 commit comments

Comments
 (0)