SF 3435567
Possibility to pass a NULL Dispatch pointer Fix a memory leak (detected with Glowcode) in Variant.cpp/zeroVariant function Variant.toString improvement to handle NULL cases Adds the error code to the message when "an unknown COM error has occurred" Added debug info to EventProxy advise registration failure message.
This commit is contained in:
@@ -795,13 +795,17 @@ public class Variant extends JacobObject {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string contents of the variant.
|
||||
* @return string contents of the variant, null if is of type null or empty
|
||||
* @throws IllegalStateException
|
||||
* if this variant is not of type String
|
||||
*/
|
||||
public String getString() {
|
||||
if (getvt() == Variant.VariantString) {
|
||||
return getVariantString();
|
||||
} else if (getvt() == Variant.VariantEmpty) {
|
||||
return null;
|
||||
} else if (getvt() == Variant.VariantNull) {
|
||||
return null;
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
"getString() only legal on Variants of type VariantString, not "
|
||||
|
||||
Reference in New Issue
Block a user