@@ -522,20 +522,26 @@ def get_cashflow(self, proxy=None, as_dict=False, freq="yearly"):
522522 def get_dividends (self , proxy = None ):
523523 if self ._history is None :
524524 self .history (period = "max" , proxy = proxy )
525- dividends = self ._history ["Dividends" ]
526- return dividends [dividends != 0 ]
525+ if self ._history is not None and "Dividends" in self ._history :
526+ dividends = self ._history ["Dividends" ]
527+ return dividends [dividends != 0 ]
528+ return []
527529
528530 def get_splits (self , proxy = None ):
529531 if self ._history is None :
530532 self .history (period = "max" , proxy = proxy )
531- splits = self ._history ["Stock Splits" ]
532- return splits [splits != 0 ]
533+ if self ._history is not None and "Stock Splits" in self ._history :
534+ splits = self ._history ["Stock Splits" ]
535+ return splits [splits != 0 ]
536+ return []
533537
534538 def get_actions (self , proxy = None ):
535539 if self ._history is None :
536540 self .history (period = "max" , proxy = proxy )
537- actions = self ._history [["Dividends" , "Stock Splits" ]]
538- return actions [actions != 0 ].dropna (how = 'all' ).fillna (0 )
541+ if self ._history is not None and "Dividends" in self ._history and "Stock Splits" in self ._history :
542+ actions = self ._history [["Dividends" , "Stock Splits" ]]
543+ return actions [actions != 0 ].dropna (how = 'all' ).fillna (0 )
544+ return []
539545
540546 def get_isin (self , proxy = None ):
541547 # *** experimental ***
0 commit comments