| @@ -174,8 +174,17 @@ | ||
| 174 | 174 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 175 | 175 | $share_with = $this->get_param( 'share_with' ); |
| 176 | 176 | $remove = $this->get_param( 'remove' ); |
| 177 | 177 | |
| 178 | + if ( empty( $title ) ) { | |
| 179 | + return $this->error( | |
| 180 | + 'invalid_name', | |
| 181 | + __( 'Workspace name cannot be empty.', 'templately' ), | |
| 182 | + 'workspaces/create', | |
| 183 | + 400 | |
| 184 | + ); | |
| 185 | + } | |
| 186 | + | |
| 178 | 187 | $post_args = [ |
| 179 | 188 | 'api_key' => $this->api_key, |
| 180 | 189 | 'id' => $id, |
| 181 | 190 | 'name' => $title, |