Skip to content

Commit

Permalink
feature #605 Enable to accept nullable.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastkidjp committed Jun 30, 2022
1 parent e393f33 commit cfc1118
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/main/java/jp/toastkid/lib/clip/Clipboard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ object Clipboard {
* @param context
* @param text
*/
fun clip(context: Context, text: String) {
fun clip(context: Context?, text: String) {
context ?: return
val cm = clipboardManager(context)
cm?.setPrimaryClip(ClipData(TEXT_DATA, ClipData.Item(text)))
}
Expand Down

0 comments on commit cfc1118

Please sign in to comment.