commit ffa2705c5958d6f054367bb1673d3edbb51d614f
Author: Herman van Rink <rink@initfour.nl>
Date:   Thu Aug 9 16:18:38 2018 +0200

    Issue #2974250 by Abhinand Gokhala K: "Parameter must be an array or an object that implements Countable" in hosting_migrate.drush.inc

diff --git a/migrate/hosting_migrate.drush.inc b/migrate/hosting_migrate.drush.inc
index 4026364..666a21b 100644
--- a/migrate/hosting_migrate.drush.inc
+++ b/migrate/hosting_migrate.drush.inc
@@ -22,7 +22,7 @@ function drush_hosting_migrate_pre_hosting_task($task) {
 
 
     $profile_instance = _hosting_migrate_get_target_profile_name($task);
-    if (sizeof($profile_instance)) {
+    if (is_array($profile_instance) && sizeof($profile_instance)) {
       $task->options['profile'] = $profile_instance->short_name;
     }
     else {
@@ -41,7 +41,7 @@ function _hosting_migrate_get_target_profile_name($task) {
     'p.short_name' => $profile->short_name,
   ));
 
-  if (!sizeof($profile_instance)) {
+  if (empty($profile_instance)) {
     // get a possible upgrade path for the profile.
     $profile_instance = hosting_package_instance_load(array(
       'i.rid' => $task->task_args['target_platform'],
