Appium screenshot have an error

why when i use river.save_screenshot(“1”+".png"),it have a error message

error: Unhandled error: TypeError: Cannot call method ‘pull’ of null
at null. (E:\software\AppiumForWindows-1.2.0.0\node_modules\appiu
m\lib\devices\android\android-controller.js:550:16)
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\asy
nc\lib\async.js:610:21
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\asy
nc\lib\async.js:249:17
at iterate (E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_mo
dules\async\lib\async.js:149:13)
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\asy
nc\lib\async.js:160:25
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\asy
nc\lib\async.js:251:21
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\asy
nc\lib\async.js:615:34
at E:\software\AppiumForWindows-1.2.0.0\node_modules\appium\node_modules\app
ium-adb\lib\adb.js:162:5
at ChildProcess.exithandler (child_process.js:635:7)
at ChildProcess.EventEmitter.emit (events.js:98:17) context: [GET /wd/hub/se
ssion/11efe780-29b2-4f9f-abed-a572707ec786/screenshot {}]

Same happens to me, but apparently its random. Most of the times doesn’t happen.

Unhandled error: TypeError: Cannot call method 'pull' of null
at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/android/android-controller.js:486:16)
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:610:21
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:249:17
at iterate (/usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:149:13)
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:160:25
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:251:21
at /usr/local/lib/node_modules/appium/node_modules/async/lib/async.js:615:34
at null.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/appium-adb/lib/adb.js:172:9)
at ChildProcess.exithandler (child_process.js:646:7)
at ChildProcess.emit (events.js:98:17) context: [GET /wd/hub/session/9ddf2da1-d52a-4a79-a147-f41e5b4be5a1/screenshot {}]